proposal: net/http: Export parseBasicAuth #22332
Closed
Labels
Milestone
Comments
CC @tombergan |
parseBasicAuth is trivial: trim "Basic ", decode base64, split on ":". I do not think it's worth expanding the API just so that custom headers can reuse those same 14 lines of code. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently
parseBasicAuth
is not exported and used only byBasicAuth
function which always uses "Authorization" header. Proxy server can use something like "Proxy-Authorization" or "XXX-Proxy-Authorization" headers and currently it's not possible to reuseparseBasicAuth
to parse basic auth payload there. My proposal would be to simply export this function so proxy servers could apply it like:The text was updated successfully, but these errors were encountered: