From c3eac70c76f923147b3dc336e43f3451b2eeabb8 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 4 Feb 2015 01:11:00 -0800 Subject: Update header handling to RFC 7230 --- main/SAPI.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'main/SAPI.c') diff --git a/main/SAPI.c b/main/SAPI.c index 0106448b7a..6a4105970a 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -744,13 +744,8 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg) /* new line/NUL character safety check */ uint i; for (i = 0; i < header_line_len; i++) { - /* RFC 2616 allows new lines if followed by SP or HT */ - int illegal_break = - (header_line[i+1] != ' ' && header_line[i+1] != '\t') - && ( - header_line[i] == '\n' - || (header_line[i] == '\r' && header_line[i+1] != '\n')); - if (illegal_break) { + /* RFC 7230 ch. 3.2.4 deprecates folding support */ + if (header_line[i] == '\n' || header_line[i] == '\r') { efree(header_line); sapi_module.sapi_error(E_WARNING, "Header may not contain " "more than a single header, new line detected"); -- cgit v1.2.1