Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn, don't raise, on opportunistic auth failure
When opportunistic_auth is enabled but an Authorization header could not be generated opportunistically, log a warning rather than raising an exception. If the request results in a 401, this reduces to the non-opportunistic case, whose behavior remains the same as before. This allows callers for whom enabling opportunistic auth is a more appropriate default to do so, without needing to write additional exception handling code to ensure they recover in the case that opportunistic auth failed. In other words, take "opportunistic" to mean "try early, but if that fails, don't just give up right away."
- Loading branch information