From 66550eb71b8fef96f169124469281e5fafc42763 Mon Sep 17 00:00:00 2001 From: yhirose Date: Mon, 16 Apr 2018 21:01:36 -0400 Subject: [PATCH] Changed to return 415 instead of 406 for invalid Content-Encoding. --- httplib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httplib.h b/httplib.h index 3c902f6..65de818 100644 --- a/httplib.h +++ b/httplib.h @@ -706,7 +706,7 @@ inline const char* status_message(int status) case 200: return "OK"; case 400: return "Bad Request"; case 404: return "Not Found"; - case 406: return "Not Acceptable"; + case 415: return "Unsupported Media Type"; default: case 500: return "Internal Server Error"; } @@ -1712,7 +1712,7 @@ inline bool Server::process_request(Stream& strm, bool last_connection) detail::decompress_request_body(req); #else if (req.get_header_value("Content-Encoding") == "gzip") { - res.status = 406; + res.status = 415; write_response(strm, last_connection, req, res); return ret; }