summaryrefslogtreecommitdiffhomepage
path: root/src/html-error.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-08-11 16:35:40 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2021-04-16 14:51:01 +0100
commita869e71ac382acb2a8b4442477ed675e5bf0ce76 (patch)
tree93acd09b5da931c0f05e43e49cb1e7a2a9d2d7a2 /src/html-error.c
parent979c737f9b811c5441ae0573a90b72dc1e44e142 (diff)
add support for outgoing connections with HTTP/1.1
since there are numerous changes in HTTP/1.1, the proxyserver will stick to using HTTP/1.0 for internal usage, however when a connection is requested with HTTP/1.x from now on we will duplicate the minor revision the client requested, because apparently some servers refuse to accept HTTP/1.0 addresses #152.
Diffstat (limited to 'src/html-error.c')
-rw-r--r--src/html-error.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/html-error.c b/src/html-error.c
index b6dd29d..998a6ee 100644
--- a/src/html-error.c
+++ b/src/html-error.c
@@ -138,13 +138,14 @@ int send_http_headers (
const char *message, const char *extra)
{
const char headers[] =
- "HTTP/1.0 %d %s\r\n"
+ "HTTP/1.%u %d %s\r\n"
"Server: %s/%s\r\n"
"Content-Type: text/html\r\n"
"%s"
"Connection: close\r\n" "\r\n";
return (write_message (connptr->client_fd, headers,
+ connptr->protocol.major != 1 ? 0 : connptr->protocol.minor,
code, message, PACKAGE, VERSION,
extra));
}