Skip to content

fix: strip trailing slashes from apiUrl - #124

Merged
pashidlos merged 1 commit into
masterfrom
fix/api-url-trailing-slash
Nov 3, 2026
Merged

pashidlos merged 1 commit into
masterfrom
fix/api-url-trailing-slash

Conversation

@pashidlos

@pashidlos pashidlos commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

An apiUrl ending in / (e.g. http://localhost:4200/) made the SDK call //builds and //test-runs. The server accepts that, but sdk-python strips the slash, so the SDKs behaved differently.

VisualRegressionTrackerConfig.getApiUrl() now drops trailing slashes, the same as sdk-python's config. Every source goes through it: constructor, builder, VRT_APIURL and vrt.json.

Tests (written first, failing before the fix):

  • one data-driven test covering the four sources;
  • shouldStartBuild now asserts the request path is /builds. The mock server URL ends in /, so before this fix every request in that suite went to //….

Real run against visualregressiontracker/api:6.0.0-rc1 (examples-java's CI compose file), with apiUrl http://…/ and a logging proxy in front of the server:

jar request lines imageUrl
master (5.6.0 code), JDK 17 POST //builds, POST //test-runs, PATCH //builds/<id> …//images/<name>
this PR, JDK 17 POST /builds, POST /test-runs, PATCH /builds/<id> …/images/<name>, serves 200

Release: a patch, 5.6.1. Nothing is published automatically: after this merges, the owner tags 5.6.1 on master and creates the GitHub release by hand, and JitPack builds from the tag.

🤖 Generated with Claude Code

An apiUrl such as http://localhost:4200/ produced requests to //builds and
//test-runs. The URL is now stripped of trailing slashes whether it comes
from the constructor, the builder, VRT_APIURL or vrt.json, as sdk-python does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pashidlos
pashidlos merged commit 72766ba into master Nov 3, 2026
1 check passed
@pashidlos
pashidlos deleted the fix/api-url-trailing-slash branch November 3, 2026 06:50
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