From: Willy Tarreau Date: Sat, 8 Jul 2006 14:53:38 +0000 (+0200) Subject: [MINOR] added lots of Content-Type: text/html to HTML responses and stats. X-Git-Tag: v1.3.1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=791d66d3634dde12339d4294aff55a1aed7518e3;p=thirdparty%2Fhaproxy.git [MINOR] added lots of Content-Type: text/html to HTML responses and stats. This suggestion from Cameron Simpson is perfectly valid and should have been implemented from the beginning. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index cfca6c9a2e..bd345b216b 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -53,6 +53,7 @@ const char *HTTP_400 = "HTTP/1.0 400 Bad request\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

400 Bad request

\nYour browser sent an invalid request.\n\n"; @@ -60,6 +61,7 @@ const char *HTTP_403 = "HTTP/1.0 403 Forbidden\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

403 Forbidden

\nRequest forbidden by administrative rules.\n\n"; @@ -67,6 +69,7 @@ const char *HTTP_408 = "HTTP/1.0 408 Request Time-out\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

408 Request Time-out

\nYour browser didn't send a complete request in time.\n\n"; @@ -74,6 +77,7 @@ const char *HTTP_500 = "HTTP/1.0 500 Server Error\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

500 Server Error

\nAn internal server error occured.\n\n"; @@ -81,6 +85,7 @@ const char *HTTP_502 = "HTTP/1.0 502 Bad Gateway\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

502 Bad Gateway

\nThe server returned an invalid or incomplete response.\n\n"; @@ -88,6 +93,7 @@ const char *HTTP_503 = "HTTP/1.0 503 Service Unavailable\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

503 Service Unavailable

\nNo server is available to handle this request.\n\n"; @@ -95,6 +101,7 @@ const char *HTTP_504 = "HTTP/1.0 504 Gateway Time-out\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n" "

504 Gateway Time-out

\nThe server didn't respond in time.\n\n"; diff --git a/src/proto_http.c b/src/proto_http.c index 0c24a05a1b..e1a7d17348 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -55,6 +55,7 @@ const char *HTTP_401_fmt = "HTTP/1.0 401 Unauthorized\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "WWW-Authenticate: Basic realm=\"%s\"\r\n" "\r\n" "

401 Unauthorized

\nYou need a valid user and password to access this content.\n\n"; @@ -2392,6 +2393,7 @@ int produce_content(struct session *s) "HTTP/1.0 200 OK\r\n" "Cache-Control: no-cache\r\n" "Connection: close\r\n" + "Content-Type: text/html\r\n" "\r\n\r\n"); s->logs.status = 200;