Fasthttp: Can we support user:pass in RequestURIs?

Created on 15 Jul 2019  路  8Comments  路  Source: valyala/fasthttp

Passing a URL struct would be nice... should not be getting this error:

(*net.AddrError)(0xc0001ea000)(address user:pass@host:1234: too many colons in address)

enhancement help wanted

Most helpful comment

All 8 comments

I guess this means you'll also want this to be turned into a Authorization: Basic ... header when a request to this URL is send?

Yeah, that was definitely the "workaround" but it just seemed "not the go way" when I was implementing it. Thank you for labeling the issue 馃憤

@dgrr that's the server side, this is about the client side of it.

Yes, I know how to do it. That's not the issue ;) Thank you though!

Ok. @durango I understand the issue but I think it requires to change the internal API a lot just to make something which is not a widely extended case. I think in this library we should tend to implement only some general purpose cases. An HTTP authentication process in the URL is so specific to make the package process all the cases in which an URL could contain credentials or not making then the URL interpreter slower. And the performance, in that case, is not only the point I want to make you be aware of. If the client has to support credentials in the URL the path to follow will be to do something like checking the URL first and if it requires authentication then perform that action. This could be done in a function or two, but again will make the developers add more code to the client making it heavier.
To conclude this comment I think it's a matter of a framework or some other package that can make that easy for the ones who want to implement that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fenny picture Fenny  路  3Comments

Fenny picture Fenny  路  4Comments

kirillDanshin picture kirillDanshin  路  5Comments

facundomedica picture facundomedica  路  4Comments

unisqu picture unisqu  路  4Comments