Skip to content

Commit

Permalink
Issue #117
Browse files Browse the repository at this point in the history
  • Loading branch information
ikod committed Mar 24, 2020
1 parent f62bf52 commit 2b2521a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/requests/http.d
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,15 @@ public struct HTTPRequest {
if ( verbosity>=1 ) {
writeln("> CONNECT %s:%d HTTP/1.1".format(_uri.host, _uri.port));
}
stream.send("CONNECT %s:%d HTTP/1.1\r\n\r\n".format(_uri.host, _uri.port));
stream.send("CONNECT %s:%d HTTP/1.1\r\n".format(_uri.host, _uri.port));
if (uri.username)
{
debug(requests) tracef("Add Proxy-Authorization header");
auto auth = new BasicAuthentication(uri.username, uri.password);
auto header = auth.authHeaders("");
stream.send("Proxy-Authorization: %s\r\n".format(header["Authorization"]));
}
stream.send("\r\n");
while ( stream.isConnected ) {
ubyte[1024] b;
auto read = stream.receive(b);
Expand Down

0 comments on commit 2b2521a

Please sign in to comment.