diff --git a/trunk/src/protocol/srs_protocol_http_stack.cpp b/trunk/src/protocol/srs_protocol_http_stack.cpp index 0c09f572c..876016c0a 100644 --- a/trunk/src/protocol/srs_protocol_http_stack.cpp +++ b/trunk/src/protocol/srs_protocol_http_stack.cpp @@ -2861,8 +2861,14 @@ reexecute: ch = *p; c = TOKEN(ch); - if (!c) - break; + if (!c) { + // Add this fix to explicitly reject space in header field names + if (ch == ' ') { + SET_ERRNO(HPE_INVALID_HEADER_TOKEN); + goto error; + } + break; + } switch (parser->header_state) { case h_general: {