Skip to content
Snippets Groups Projects
Commit 977a0aae authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Protocols.HTTP: Set the Host header for proxied requests.

parent f75ba41a
Branches
Tags
No related merge requests found
......@@ -85,6 +85,11 @@ constant DAV_STORAGE_FULL = 507; // RFC 2518 10.6: Insufficient Storage
proxy_headers["Proxy-Authorization"] = "Basic "
+ MIME.encode_base64((user || "") + ":" + (password || ""));
if (has_value(proxy->host, ":")) {
proxy_headers["host"] = "[" + proxy->host + "]:" + proxy->port;
} else {
proxy_headers["host"] = proxy->host + ":" + proxy->port;
}
}
if (url->scheme == "http") {
......@@ -463,6 +468,11 @@ void do_async_proxied_method(string|Standards.URI proxy,
proxy_headers["Proxy-Authorization"] = "Basic "
+ MIME.encode_base64((user || "") + ":" + (password || ""));
if (has_value(proxy->host, ":")) {
proxy_headers["host"] = "[" + proxy->host + "]:" + proxy->port;
} else {
proxy_headers["host"] = proxy->host + ":" + proxy->port;
}
}
if (url->scheme == "http") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment