Repository navigation
fix(streaming): send an origin to the video gateway - #279
Merged
Merged
Conversation
The pages of the packaged app are loaded from file://, so the WHEP requests to the video gateway carry no Origin header while Chromium marks them as cross-site. MediaMTX refuses them with 403 before checking the token, and the door phone video is never shown. In dev mode the pages come from the Vite server, which sends an origin. Send the requests to the video gateway with the origin of the gateway when they have none: the access is still granted by the token only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The door phone video is never shown in the released NethLink, while it works in dev mode. NethServer/dev#7535
The pages of the packaged app are loaded from
file://, so the requests to the video gateway (WHEP) carry noOriginheader while Chromium marks them as cross-site. MediaMTX refuses such requests with 403 before checking their token, so the video stays "not available". In dev mode the pages come from the Vite server, which sends an origin, and the video plays. NethLink now gives the requests to/streaming-gw/the origin of the gateway when they have none: access is still granted only by the token of the request.How to test
POST /streaming-gw/<source>/whepanswer is 201, not 403.See also