Skip to content
Snippets Groups Projects
Commit d2ac58af authored by Johan Sundström's avatar Johan Sundström
Browse files

Support for [http://]user:passwd@[rest of URI] password syntax only

available to the Protocols.HTTP methods when MIME.encode_base64 is
present in your pike. (Under what circumstances isn't it, by the way?)

Rev: lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:1.21
parent c6ec828a
No related branches found
No related tags found
No related merge requests found
......@@ -82,10 +82,12 @@ object do_method(string method,
mapping default_headers = ([
"user-agent" : "Mozilla/4.0 compatible (Pike HTTP client)",
"host" : url->host ]);
#if MIME.encode_base64
if(url->user || url->passwd)
default_headers->authorization = "Basic "
+ MIME.encode_base64(url->user + ":" +
(url->password || ""));
#endif
request_headers = default_headers | request_headers;
string query=url->query;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment