summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-08 15:02:25 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-08 15:02:25 +0100
commit12403a9a19db8c3a31c92d57199e316e4d7a27a3 (patch)
tree0c3734a17bb029bc662e5376db2cc5bc984bb18d
parent835f0bdd983c193dd708771164856db8ccae6e42 (diff)
duplicate HTTP version also in error messages
-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 c94dbd7..95ee9cf 100644
--- a/src/html-error.c
+++ b/src/html-error.c
@@ -131,7 +131,7 @@ send_html_file (FILE *infile, struct conn_s *connptr)
int send_http_headers (struct conn_s *connptr, int code, const char *message)
{
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"
@@ -150,6 +150,7 @@ int send_http_headers (struct conn_s *connptr, int code, const char *message)
const char *add = code == 407 ? p_auth_str : (code == 401 ? w_auth_str : "");
return (write_message (connptr->client_fd, headers,
+ connptr->protocol.major != 1 ? 0 : connptr->protocol.minor,
code, message, PACKAGE, VERSION,
add));
}