Skip to content

fix: strip trailing slash from endpoint in Search#14

Merged
acoshift merged 1 commit into
mainfrom
fix/search-trailing-slash
May 25, 2026
Merged

fix: strip trailing slash from endpoint in Search#14
acoshift merged 1 commit into
mainfrom
fix/search-trailing-slash

Conversation

@acoshift
Copy link
Copy Markdown
Member

Summary

  • Search built its URL as c.endpoint+"/search" without first stripping a trailing slash, producing …/index//search when the caller passes a trailing-slash endpoint.
  • The ingest path (constructed in loop) already applies strings.TrimSuffix(endpoint, "/") correctly. This brings Search in line with that convention.

Test plan

  • TestSearch_TrailingSlashEndpoint — passes a trailing-slash endpoint and asserts the captured server path contains no // and ends with /search
  • go test ./... passes

🤖 Generated with Claude Code

The ingest path (built in loop) already called strings.TrimSuffix on the
endpoint before appending "/ingest", but Search used c.endpoint+"/search"
directly. A caller who passes an endpoint with a trailing slash would get
a double-slash URL (e.g. /api/v1/index//search) that servers and proxies
commonly reject with 404 or 400.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@acoshift acoshift merged commit f12dd7c into main May 25, 2026
1 check passed
@acoshift acoshift deleted the fix/search-trailing-slash branch May 25, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant