]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] added lots of Content-Type: text/html to HTML responses and stats.
authorWilly Tarreau <w@1wt.eu>
Sat, 8 Jul 2006 14:53:38 +0000 (16:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Jul 2006 14:13:17 +0000 (16:13 +0200)
This suggestion from Cameron Simpson is perfectly valid and should have been
implemented from the beginning.

src/cfgparse.c
src/proto_http.c

index cfca6c9a2eda7b33b1df87424d338c9d6e9a2e33..bd345b216b785eceff3716c23e2e0908174dca2f 100644 (file)
@@ -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"
        "<html><body><h1>400 Bad request</h1>\nYour browser sent an invalid request.\n</body></html>\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"
        "<html><body><h1>403 Forbidden</h1>\nRequest forbidden by administrative rules.\n</body></html>\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"
        "<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\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"
        "<html><body><h1>500 Server Error</h1>\nAn internal server error occured.\n</body></html>\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"
        "<html><body><h1>502 Bad Gateway</h1>\nThe server returned an invalid or incomplete response.\n</body></html>\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"
        "<html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>\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"
        "<html><body><h1>504 Gateway Time-out</h1>\nThe server didn't respond in time.\n</body></html>\n";
 
index 0c24a05a1bfd829e3d269ae3a310f7705e2c066e..e1a7d17348376f82d0179f69da1663a65df49a79 100644 (file)
@@ -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"
        "<html><body><h1>401 Unauthorized</h1>\nYou need a valid user and password to access this content.\n</body></html>\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;