Skip to content

fix-low: don't add the host's path twice to paths zm-api writes behind a proxy - #67

Merged
SteveGilvarry merged 1 commit into
ZoneMinder:mainfrom
nabbi:fix/az28-v3-path-prefix
Oct 27, 2026
Merged

SteveGilvarry merged 1 commit into
ZoneMinder:mainfrom
nabbi:fix/az28-v3-path-prefix

Conversation

@nabbi

@nabbi nabbi commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Impact: low (behind a proxy path with zm-api's public_prefix set, WebRTC candidates and session closes go to /zm/zm/... and are lost)

Automated PR, tested in a zm-holodeck sandbox. An AI agent (Claude Opus 5.5) wrote this against a disposable
lab (nginx serving zm-api's routes under /zm, a stub answering as zm-api main 1e7c5f8 with its prefix set)
and ran the checks there. Minimal human review before opening: please review it as you would any contributor's PR.

TL;DR

Fixes #66

🤖 Generated with Claude Code

Served behind a proxy path (http://host/zm), zm-api with its
server.public_prefix writes absolute paths that already carry the prefix,
such as a WHEP session's Location
(/zm/api/v3/live/<id>/webrtc/whep/<session>). Joined onto a host ending in
/zm they became /zm/zm/..., so ICE candidates and session closes never
reached zm-api.

Strip the host's own path from an absolute path that starts with it;
paths without the prefix, and hosts without a path, are joined as before.

Fixes ZoneMinder#66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SteveGilvarry
SteveGilvarry merged commit b712f90 into ZoneMinder:main Oct 27, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API v3: behind a proxy path, the WHEP session URL gets the prefix twice

2 participants