Open mirko opened 1 month ago
Thanks for the contribution.
This package is actually quite outdated now. It still works but there's a much newer python-ecosys/aiohttp
package which has a lot more features than this one (although not basic auth yet...).
Do you have a particular reason to use uaiohttpclient
?
If we continue to maintain this package then it should offer something different to python-ecosys/aiohttp
. For example this one should be much more light weight.
I just picked the first async HTTP client lib I found, verified it working, embedding it into my project - and found out (way too late), it lacks HTTP auth. And instead of searching around and trying out other libs with each havingtheir own quirks and uasynciohttpclient basically working for me. I just hacked it in and created this PR.
OK, thanks for the explanation.
I'm happy to accept the changes in this PR, but will make some more specific comments about them.
Allows HTTP Basic Auth URLs being passed, parsed and handled correctly to authorise against a server expecting that. This is a simplification, completely ignoring if the server supports or asks for HTTP Basic Auth. We simply format and set the header if the URL indicates so.
This also fixes parsing URLs containing a colon (':') /not/ indicating a custom port (but e.g. the seperation between user and password as part of the HTTP Basic Auth credentials).
Previously, the lib died ungracefully when parsing an URL containing HTTP Basic Auth credentials, as it was always expecting at most only one colon (':') and also the part coming afterwards being neccesarily a number (port).