fix: prevent double slashes in AliasGetReq path when Indices is empty - #802
fix: prevent double slashes in AliasGetReq path when Indices is empty#802anzzyspeaksgit wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #802 +/- ##
==========================================
+ Coverage 72.05% 72.13% +0.07%
==========================================
Files 427 427
Lines 15568 15571 +3
==========================================
+ Hits 11218 11232 +14
+ Misses 2668 2658 -10
+ Partials 1682 1681 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
There's also a fix posted for this in #804 , too. |
|
Thanks for the fix, @anzzyspeaksgit. Just to give you a status update: the underlying bug (#617) was fixed by #804 (merged 2026-05-28), which moved URL-path construction into a generated I'd like to close this PR as resolved by #804. Could you verify the current behavior on main matches what you needed? If you find any case still producing double slashes, please open a new issue with a reproducer and we'll dig in. Thanks again for the contribution. |
Problem
When calling
AliasGetReqwithout specifyingIndices(or providing an emptyIndicesarray/slice), the resulting API path incorrectly contains a double slash.For example, it might produce
//_alias/test-aliasinstead of/_alias/test-alias. This double slash causes issues for proxies or when interacting with some clusters, such as Aiven where this causes failures (see #617).Solution
I modified the
GetRequestfunction inopensearchapi/api_indices-alias.goto conditionally append the initial/andindicesstring only ifindicesis not empty. Ifindicesis empty, it appends only/_alias/and the aliases name(s), ensuring the URL path is valid (e.g./_alias/test-alias).Testing
make testthat all existing tests pass correctly.Closes #617