Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization middleware supports cookie or authorization header #594

Merged
merged 2 commits into from
Dec 29, 2023

Conversation

niamu
Copy link
Contributor

@niamu niamu commented Dec 20, 2023

This change in the middleware supports both the Authorization header and Cookie methods of retrieving a valid auth token for a request.


CCCP reported this issue via Discord:

I'm getting a 401 unauthorized error on the stream.ass when using subtitles, with the experimental SSA/ASS subtitles turned on (so the subtitles do not work)
the request header appears to contain the cookie (token=value) but not the Authorization=value header.
"GET /api/v1/stream/991698fc-1e7f-448c-876a-bc329d83e908/data/stream.ass HTTP/1.1
Host: ip:8001
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Referer: http://ip:8001/static/media/jassub-worker.555dbf2f1bc54cf00628.js
Cookie: token=cookietokenvalue"

Using curl, if i do not send the Authorization header, i get {"error":"NoToken","messsage":"Invite token required."}
but if i send the correct -H "Authorization: token" header, then i get the subtitles without a problem.

@mental32 mental32 merged commit 3ccb4ab into Dusk-Labs:master Dec 29, 2023
1 check passed
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.

2 participants