[PATCH 2 of 3] Proxy: whitespaces after chunk size allowed

Maxim Dounin mdounin at mdounin.ru
Sun Sep 25 10:42:05 UTC 2011


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1316882053 -14400
# Node ID 4a179d089c41bb2e8dbc606e3db8064899907193
# Parent  f1cbffaa09dcc5e8d9f3fc888abcac8e6e7c38b3
Proxy: whitespaces after chunk size allowed.

Whitespaces after chunk size seems to be be allowed by the "implied *LWS" rule
and emitted by some servers.

diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1647,6 +1647,8 @@ ngx_http_proxy_parse_chunked(ngx_http_re
                     state = sw_trailer;
                     break;
                 case ';':
+                case ' ':
+                case '\t':
                     state = sw_last_chunk_extension;
                     break;
                 default:
@@ -1664,6 +1666,8 @@ ngx_http_proxy_parse_chunked(ngx_http_re
                 state = sw_chunk_data;
                 break;
             case ';':
+            case ' ':
+            case '\t':
                 state = sw_chunk_extension;
                 break;
             default:



More information about the nginx-devel mailing list