summaryrefslogtreecommitdiffhomepage
path: root/src/reqs.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-11-16 23:57:14 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2020-11-16 23:57:14 +0100
commit064d391854f78ebb4fa311638dd0841227dc60b4 (patch)
treed925262fbc34ae68a5bcaa197d4fa4e4d587fb9f /src/reqs.c
parentaeee18457c5834b06f902f25ca2e7b80302b9f97 (diff)
parent12403a9a19db8c3a31c92d57199e316e4d7a27a3 (diff)
Merge branches 'bind-ipv4mapped' and 'support_http_11'
Diffstat (limited to 'src/reqs.c')
-rw-r--r--src/reqs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 6531be2..f6fd2be 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -268,28 +268,34 @@ establish_http_connection (struct conn_s *connptr, struct request_s *request)
/* host is an IPv6 address literal, so surround it with
* [] */
return write_message (connptr->server_fd,
- "%s %s HTTP/1.0\r\n"
+ "%s %s HTTP/1.%u\r\n"
"Host: [%s]%s\r\n"
"Connection: close\r\n",
request->method, request->path,
+ connptr->protocol.major != 1 ? 0 :
+ connptr->protocol.minor,
request->host, portbuff);
} else if (connptr->upstream_proxy &&
connptr->upstream_proxy->type == PT_HTTP &&
connptr->upstream_proxy->ua.authstr) {
return write_message (connptr->server_fd,
- "%s %s HTTP/1.0\r\n"
+ "%s %s HTTP/1.%u\r\n"
"Host: %s%s\r\n"
"Connection: close\r\n"
"Proxy-Authorization: Basic %s\r\n",
request->method, request->path,
+ connptr->protocol.major != 1 ? 0 :
+ connptr->protocol.minor,
request->host, portbuff,
connptr->upstream_proxy->ua.authstr);
} else {
return write_message (connptr->server_fd,
- "%s %s HTTP/1.0\r\n"
+ "%s %s HTTP/1.%u\r\n"
"Host: %s%s\r\n"
"Connection: close\r\n",
request->method, request->path,
+ connptr->protocol.major != 1 ? 0 :
+ connptr->protocol.minor,
request->host, portbuff);
}
}