diff --git a/.gitattributes b/.gitattributes index 4b566452d9b77..7c1e779c003b9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ SUBVERS export-subst VERDATE export-subst *.[ch] diff=cpp + +*.http text eol=lf diff --git a/examples/errorfiles/400.http b/examples/errorfiles/400.http index e223e38d99e3d..6785e9dc97d5d 100644 --- a/examples/errorfiles/400.http +++ b/examples/errorfiles/400.http @@ -1,8 +1,7 @@ -HTTP/1.0 400 Bad request -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 400 Bad request +Connection: close +Content-Type: text/html +

400 Bad request

Your browser sent an invalid request. diff --git a/examples/errorfiles/403.http b/examples/errorfiles/403.http index a67e807550e4c..531211743cf58 100644 --- a/examples/errorfiles/403.http +++ b/examples/errorfiles/403.http @@ -1,8 +1,7 @@ -HTTP/1.0 403 Forbidden -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 403 Forbidden +Connection: close +Content-Type: text/html +

403 Forbidden

Request forbidden by administrative rules. diff --git a/examples/errorfiles/408.http b/examples/errorfiles/408.http index aafb1300fb13e..bb5a8d4b941a0 100644 --- a/examples/errorfiles/408.http +++ b/examples/errorfiles/408.http @@ -1,8 +1,7 @@ -HTTP/1.0 408 Request Time-out -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 408 Request Time-out +Connection: close +Content-Type: text/html +

408 Request Time-out

Your browser didn't send a complete request in time. diff --git a/examples/errorfiles/500.http b/examples/errorfiles/500.http index 9c3be965c07f4..224792e8fa616 100644 --- a/examples/errorfiles/500.http +++ b/examples/errorfiles/500.http @@ -1,8 +1,7 @@ -HTTP/1.0 500 Internal Server Error -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 500 Internal Server Error +Connection: close +Content-Type: text/html +

500 Internal Server Error

An internal server error occurred. diff --git a/examples/errorfiles/502.http b/examples/errorfiles/502.http index 94b35d49284a7..0b3d72d207f18 100644 --- a/examples/errorfiles/502.http +++ b/examples/errorfiles/502.http @@ -1,8 +1,7 @@ -HTTP/1.0 502 Bad Gateway -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 502 Bad Gateway +Connection: close +Content-Type: text/html +

502 Bad Gateway

The server returned an invalid or incomplete response. diff --git a/examples/errorfiles/503.http b/examples/errorfiles/503.http index 48fde5881e680..049e67d69500f 100644 --- a/examples/errorfiles/503.http +++ b/examples/errorfiles/503.http @@ -1,8 +1,7 @@ -HTTP/1.0 503 Service Unavailable -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 503 Service Unavailable +Connection: close +Content-Type: text/html +

503 Service Unavailable

No server is available to handle this request. diff --git a/examples/errorfiles/504.http b/examples/errorfiles/504.http index f92518414c958..d4ed049a4cded 100644 --- a/examples/errorfiles/504.http +++ b/examples/errorfiles/504.http @@ -1,8 +1,7 @@ -HTTP/1.0 504 Gateway Time-out -Cache-Control: no-cache -Connection: close -Content-Type: text/html - +HTTP/1.0 504 Gateway Time-out +Connection: close +Content-Type: text/html +

504 Gateway Time-out

The server didn't respond in time. diff --git a/reg-tests/http-errorfiles/errors/400-1.http b/reg-tests/http-errorfiles/errors/400-1.http index 86a2e693dbe65..e69f26f586d45 100644 --- a/reg-tests/http-errorfiles/errors/400-1.http +++ b/reg-tests/http-errorfiles/errors/400-1.http @@ -1,9 +1,8 @@ -HTTP/1.1 400 Bad request -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-1 - +HTTP/1.1 400 Bad request +Connection: close +Content-Type: text/html +x-err-type: errors-1 +

400 Bad request

Your browser sent an invalid request. diff --git a/reg-tests/http-errorfiles/errors/400-2.http b/reg-tests/http-errorfiles/errors/400-2.http index c10851036d3cb..8c9ee94185907 100644 --- a/reg-tests/http-errorfiles/errors/400-2.http +++ b/reg-tests/http-errorfiles/errors/400-2.http @@ -1,9 +1,8 @@ -HTTP/1.1 400 Bad request -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-2 - +HTTP/1.1 400 Bad request +Connection: close +Content-Type: text/html +x-err-type: errors-2 +

400 Bad request

Your browser sent an invalid request. diff --git a/reg-tests/http-errorfiles/errors/400-3.http b/reg-tests/http-errorfiles/errors/400-3.http index 1fe18410b02b2..51b09e53545c5 100644 --- a/reg-tests/http-errorfiles/errors/400-3.http +++ b/reg-tests/http-errorfiles/errors/400-3.http @@ -1,9 +1,8 @@ -HTTP/1.1 400 Bad request -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-3 - +HTTP/1.1 400 Bad request +Connection: close +Content-Type: text/html +x-err-type: errors-3 +

400 Bad request

Your browser sent an invalid request. diff --git a/reg-tests/http-errorfiles/errors/400.http b/reg-tests/http-errorfiles/errors/400.http index ce229aa9f1005..3883fd12251f7 100644 --- a/reg-tests/http-errorfiles/errors/400.http +++ b/reg-tests/http-errorfiles/errors/400.http @@ -1,9 +1,8 @@ -HTTP/1.1 400 Bad request -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: default - +HTTP/1.1 400 Bad request +Connection: close +Content-Type: text/html +x-err-type: default +

400 Bad request

Your browser sent an invalid request. diff --git a/reg-tests/http-errorfiles/errors/403-1.http b/reg-tests/http-errorfiles/errors/403-1.http index 08bdf02af2954..f5419ae089f3f 100644 --- a/reg-tests/http-errorfiles/errors/403-1.http +++ b/reg-tests/http-errorfiles/errors/403-1.http @@ -1,9 +1,8 @@ -HTTP/1.0 403 Forbidden -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-1 - +HTTP/1.0 403 Forbidden +Connection: close +Content-Type: text/html +x-err-type: errors-1 +

403 Forbidden

Request forbidden by administrative rules. diff --git a/reg-tests/http-errorfiles/errors/403-2.http b/reg-tests/http-errorfiles/errors/403-2.http index 9c07e5dd0a600..956f0ee601994 100644 --- a/reg-tests/http-errorfiles/errors/403-2.http +++ b/reg-tests/http-errorfiles/errors/403-2.http @@ -1,9 +1,8 @@ -HTTP/1.0 403 Forbidden -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-2 - +HTTP/1.0 403 Forbidden +Connection: close +Content-Type: text/html +x-err-type: errors-2 +

403 Forbidden

Request forbidden by administrative rules. diff --git a/reg-tests/http-errorfiles/errors/403.http b/reg-tests/http-errorfiles/errors/403.http index fd969b200fe50..12f5e342e283b 100644 --- a/reg-tests/http-errorfiles/errors/403.http +++ b/reg-tests/http-errorfiles/errors/403.http @@ -1,9 +1,8 @@ -HTTP/1.0 403 Forbidden -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: default - +HTTP/1.0 403 Forbidden +Connection: close +Content-Type: text/html +x-err-type: default +

403 Forbidden

Request forbidden by administrative rules. diff --git a/reg-tests/http-errorfiles/errors/404-1.http b/reg-tests/http-errorfiles/errors/404-1.http index 154ed0be7c5eb..96e692c56b935 100644 --- a/reg-tests/http-errorfiles/errors/404-1.http +++ b/reg-tests/http-errorfiles/errors/404-1.http @@ -1,9 +1,8 @@ -HTTP/1.1 404 Not Found -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-1 - +HTTP/1.1 404 Not Found +Connection: close +Content-Type: text/html +x-err-type: errors-1 +

404 Not Found

The resource could not be found. diff --git a/reg-tests/http-errorfiles/errors/404-2.http b/reg-tests/http-errorfiles/errors/404-2.http index e26f91dc0b6fe..85b7da23ada6d 100644 --- a/reg-tests/http-errorfiles/errors/404-2.http +++ b/reg-tests/http-errorfiles/errors/404-2.http @@ -1,9 +1,8 @@ -HTTP/1.1 404 Not Found -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-2 - +HTTP/1.1 404 Not Found +Connection: close +Content-Type: text/html +x-err-type: errors-2 +

404 Not Found

The resource could not be found. diff --git a/reg-tests/http-errorfiles/errors/404-3.http b/reg-tests/http-errorfiles/errors/404-3.http index 4bc166106cdbb..79fce19220de2 100644 --- a/reg-tests/http-errorfiles/errors/404-3.http +++ b/reg-tests/http-errorfiles/errors/404-3.http @@ -1,9 +1,8 @@ -HTTP/1.1 404 Not Found -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-3 - +HTTP/1.1 404 Not Found +Connection: close +Content-Type: text/html +x-err-type: errors-3 +

404 Not Found

The resource could not be found. diff --git a/reg-tests/http-errorfiles/errors/404.http b/reg-tests/http-errorfiles/errors/404.http index 8dacd953d9773..5272a38fa81f3 100644 --- a/reg-tests/http-errorfiles/errors/404.http +++ b/reg-tests/http-errorfiles/errors/404.http @@ -1,9 +1,8 @@ -HTTP/1.1 404 Not Found -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: default - +HTTP/1.1 404 Not Found +Connection: close +Content-Type: text/html +x-err-type: default +

404 Not Found

The resource could not be found. diff --git a/reg-tests/http-errorfiles/errors/500-1.http b/reg-tests/http-errorfiles/errors/500-1.http index 4e4f7e428352b..411e358c41317 100644 --- a/reg-tests/http-errorfiles/errors/500-1.http +++ b/reg-tests/http-errorfiles/errors/500-1.http @@ -1,9 +1,8 @@ -HTTP/1.0 500 Internal Server Error -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: errors-1 - +HTTP/1.0 500 Internal Server Error +Connection: close +Content-Type: text/html +x-err-type: errors-1 +

500 Internal Server Error

An internal server error occurred. diff --git a/reg-tests/http-errorfiles/errors/500.http b/reg-tests/http-errorfiles/errors/500.http index 68a31ff44db31..b51376e25ac4f 100644 --- a/reg-tests/http-errorfiles/errors/500.http +++ b/reg-tests/http-errorfiles/errors/500.http @@ -1,9 +1,8 @@ -HTTP/1.0 500 Internal Server Error -Cache-Control: no-cache -Connection: close -Content-Type: text/html -x-err-type: default - +HTTP/1.0 500 Internal Server Error +Connection: close +Content-Type: text/html +x-err-type: default +

500 Internal Server Error

An internal server error occurred. diff --git a/src/http.c b/src/http.c index b58185a26a436..7b536de73ca42 100644 --- a/src/http.c +++ b/src/http.c @@ -192,7 +192,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_400] = "HTTP/1.1 400 Bad request\r\n" "Content-length: 90\r\n" - "Cache-Control: no-cache\r\n" "Connection: close\r\n" "Content-Type: text/html\r\n" "\r\n" @@ -201,7 +200,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_401] = "HTTP/1.1 401 Unauthorized\r\n" "Content-length: 112\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

401 Unauthorized

\nYou need a valid user and password to access this content.\n\n", @@ -209,7 +207,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_403] = "HTTP/1.1 403 Forbidden\r\n" "Content-length: 93\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

403 Forbidden

\nRequest forbidden by administrative rules.\n\n", @@ -217,7 +214,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_404] = "HTTP/1.1 404 Not Found\r\n" "Content-length: 83\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

404 Not Found

\nThe resource could not be found.\n\n", @@ -225,7 +221,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_405] = "HTTP/1.1 405 Method Not Allowed\r\n" "Content-length: 147\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

405 Method Not Allowed

\nA request was made of a resource using a request method not supported by that resource.\n\n", @@ -233,7 +228,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_407] = "HTTP/1.1 407 Unauthorized\r\n" "Content-length: 112\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

407 Unauthorized

\nYou need a valid user and password to access this content.\n\n", @@ -241,7 +235,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_408] = "HTTP/1.1 408 Request Time-out\r\n" "Content-length: 110\r\n" - "Cache-Control: no-cache\r\n" "Connection: close\r\n" "Content-Type: text/html\r\n" "\r\n" @@ -250,7 +243,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_410] = "HTTP/1.1 410 Gone\r\n" "Content-length: 114\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

410 Gone

\nThe resource is no longer available and will not be available again.\n\n", @@ -258,7 +250,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_413] = "HTTP/1.1 413 Payload Too Large\r\n" "Content-length: 106\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

413 Payload Too Large

\nThe request entity exceeds the maximum allowed.\n\n", @@ -266,7 +257,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_414] = "HTTP/1.1 414 URI Too Long\r\n" "Content-length: 110\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

414 URI Too Long

\nThe URI provided was too long for the server to process.\n\n", @@ -274,7 +264,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_421] = "HTTP/1.1 421 Misdirected Request\r\n" "Content-length: 104\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

421 Misdirected Request

\nRequest sent to a non-authoritative server.\n\n", @@ -282,7 +271,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_422] = "HTTP/1.1 422 Unprocessable Content\r\n" "Content-length: 116\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

422 Unprocessable Content

\nThe server cannot process the contained instructions.\n\n", @@ -290,7 +278,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_425] = "HTTP/1.1 425 Too Early\r\n" "Content-length: 80\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

425 Too Early

\nYour browser sent early data.\n\n", @@ -298,7 +285,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_429] = "HTTP/1.1 429 Too Many Requests\r\n" "Content-length: 117\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

429 Too Many Requests

\nYou have sent too many requests in a given amount of time.\n\n", @@ -306,7 +292,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_431] = "HTTP/1.1 431 Request Header Fields Too Large\r\n" "Content-length: 105\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

431 Request Header Fields Too Large

\nRequest Header Fields Too Large.\n\n", @@ -314,7 +299,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_500] = "HTTP/1.1 500 Internal Server Error\r\n" "Content-length: 97\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

500 Internal Server Error

\nAn internal server error occurred.\n\n", @@ -322,7 +306,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_501] = "HTTP/1.1 501 Not Implemented\r\n" "Content-length: 135\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

501 Not Implemented

\nThe server does not support the functionality required to fulfill the request.\n\n", @@ -330,7 +313,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_502] = "HTTP/1.1 502 Bad Gateway\r\n" "Content-length: 107\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

502 Bad Gateway

\nThe server returned an invalid or incomplete response.\n\n", @@ -338,7 +320,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_503] = "HTTP/1.1 503 Service Unavailable\r\n" "Content-length: 107\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

503 Service Unavailable

\nNo server is available to handle this request.\n\n", @@ -346,7 +327,6 @@ const char *http_err_msgs[HTTP_ERR_SIZE] = { [HTTP_ERR_504] = "HTTP/1.1 504 Gateway Time-out\r\n" "Content-length: 92\r\n" - "Cache-Control: no-cache\r\n" "Content-Type: text/html\r\n" "\r\n" "

504 Gateway Time-out

\nThe server didn't respond in time.\n\n",