Skip to content

Commit 7f0f6d3

Browse files
authored
http_fopen_wrapper.c - Handle HTTP 101
Don't wait for further responses after a HTTP 101 (Switching Protocols) response
1 parent ae0585c commit 7f0f6d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/http_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
680680
/* status codes of 1xx are "informational", and will be followed by a real response
681681
* e.g "100 Continue". RFC 7231 states that unexpected 1xx status MUST be parsed,
682682
* and MAY be ignored. As such, we need to skip ahead to the "real" status*/
683-
if (response_code >= 100 && response_code < 200) {
683+
if (response_code >= 100 && response_code < 200 && response_code != 101) {
684684
/* consume lines until we find a line starting 'HTTP/1' */
685685
while (
686686
!php_stream_eof(stream)

0 commit comments

Comments
 (0)