replicate / replicate-swift

Swift client for Replicate
https://replicate.com
Apache License 2.0
157 stars 33 forks source link

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

Closed mattt closed 11 months ago

mattt commented 11 months ago

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.