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

Should Blossom endpoints return 401 instead of 400 when the request lacks an Authorization header? #25

Closed
tealeaf-dot-dev opened this issue Dec 31, 2024 · 1 comment · Fixed by #26

Comments

@tealeaf-dot-dev
Copy link

E.g. the HEAD /upload endpoint returns 400

blossomError(w, err.Error(), 400)

BUD 06 ...

"If the server requires authorization to upload it may respond with the 401 status code"

Returning 400 is causing uploads to fail between relays that use Khatru (e.g. Haven) and clients that use blossom-client-sdk (e.g. noStrudel) ... because blossom-client-sdk never sends an Authorization header to HEAD /upload and only sends one to PUT /upload if the response from HEAD /upload is 401

cc @barrydeen @hzrd149

@aaccioly
Copy link
Contributor

aaccioly commented Jan 26, 2025

Yes, and this fixes media uploads on noStrudel. I'm opening a PR right now.

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 a pull request may close this issue.

2 participants