From 9f7c594a49f35e7a4f652a57930d152374ddd203 Mon Sep 17 00:00:00 2001 From: Szabo Bogdan Date: Mon, 16 Mar 2015 01:43:13 +0200 Subject: [PATCH] Fixed chunked Bad Response for Darwin/14.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The apple’s user agent Darwin/14.3.0 send the “Transfer-Encoding” header value “Chunked” which make vibe.d to fail --- source/vibe/http/server.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/http/server.d b/source/vibe/http/server.d index 54532e2da8..404eb0a195 100644 --- a/source/vibe/http/server.d +++ b/source/vibe/http/server.d @@ -1475,7 +1475,7 @@ private bool handleRequest(Stream http_stream, TCPConnection tcp_connection, HTT enforceBadRequest(settings.maxRequestSize <= 0 || contentLength <= settings.maxRequestSize, "Request size too big"); limited_http_input_stream = FreeListRef!LimitedHTTPInputStream(reqReader, contentLength); } else if (auto pt = "Transfer-Encoding" in req.headers) { - enforceBadRequest(*pt == "chunked"); + enforceBadRequest(*pt == "chunked" || *pt == "Chunked"); chunked_input_stream = FreeListRef!ChunkedInputStream(reqReader); limited_http_input_stream = FreeListRef!LimitedHTTPInputStream(chunked_input_stream, settings.maxRequestSize, true); } else {