Closed dylancwood closed 9 years ago
Since this isn't an issue with the documentation, I'm closing the issue. I'll let our development team know about it.
Thank you @dylancwood for your informative bug report :+1:
You're very welcome. I'll be sure to send further reports to the support team instead of posting them here.
I just signed up for my Cloudant account today, and have enjoyed it thus far! Thank you for making this tool available at an affordable price point. I did come across an unintuitive response from Cloudant that I want to suggest a solution for. I have no idea if this is the right place for submitting this issue.
Background
The Cloudant API allows for HTTP BASIC authentication using the following header format:
Problem
This functionality works very well, except when an invalid base64 string is passed in. I accidentally left a trailing
=
off the end of my auth token, and received a "502 Bad Gateway" response from the Cloudant API.This response did not give me any clue as to where my problem might be.
Suggested Solution
I am guessing that your servers encountered an unknown error when trying to decode the Authorization token, and that unknown error resulted in an incomplete response to your load balancer / reverse proxy. I suggest specifically handling the case that the Authorization token cannot be base64 decoded, and replying with a
401 Unauthorized
status code and the messageInvalid basic authorization token in header
.