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

Don't set Authorization header unless API token is provided #52

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

mattt
Copy link
Member

@mattt mattt commented Oct 5, 2023

Sending a blank token results in requests having an Authorization: Token header, to which Replicate's API responds with a 422 error instead of a 401. This PR prevents empty tokens from being sent, so that the client receives the more instructive server error.

@mattt mattt merged commit 9e4fc82 into main Oct 5, 2023
2 checks passed
@mattt mattt deleted the mattt/conditional-auth-header branch October 5, 2023 19:00
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.

None yet

1 participant