Closed adeko closed 4 years ago
I've noticed some protocol checks for HTTP/1.1.
web.php && preg_grep('/HTTP\/\d\.\d 200/',$response['headers']) preg_grep('/HTTP\/1\.\d 3\d{2}/',$headers) && if (preg_match('/HTTP\/1\.\d 304/',
&& preg_grep('/HTTP\/\d\.\d 200/',$response['headers'])
preg_grep('/HTTP\/1\.\d 3\d{2}/',$headers) &&
if (preg_match('/HTTP\/1\.\d 304/',
ws.php if (preg_match('/^(\w+)\s(.+)\sHTTP\/1\.\d$/', 'HTTP/1.1 400 Bad Request'.$EOL.
if (preg_match('/^(\w+)\s(.+)\sHTTP\/1\.\d$/',
'HTTP/1.1 400 Bad Request'.$EOL.
Etc.
[Question] We already have HTTP/1.1, HTTP/2 and HTTP/3. Should this code be updated?
E.g. preg_grep('/HTTP\/\d\.\d 200/',$response['headers']) replace with preg_grep('/HTTP\/[\d\.]{1,3} 200/',$response['headers'])
preg_grep('/HTTP\/\d\.\d 200/',$response['headers'])
preg_grep('/HTTP\/[\d\.]{1,3} 200/',$response['headers'])
No bad idea.. fixed in https://github.com/bcosca/fatfree-core/commit/39380a1d9e243bf1f5d55f4d53c6666f943449b1
I've noticed some protocol checks for HTTP/1.1.
web.php
&& preg_grep('/HTTP\/\d\.\d 200/',$response['headers'])
preg_grep('/HTTP\/1\.\d 3\d{2}/',$headers) &&
if (preg_match('/HTTP\/1\.\d 304/',
ws.php
if (preg_match('/^(\w+)\s(.+)\sHTTP\/1\.\d$/',
'HTTP/1.1 400 Bad Request'.$EOL.
Etc.
[Question] We already have HTTP/1.1, HTTP/2 and HTTP/3. Should this code be updated?
E.g.
preg_grep('/HTTP\/\d\.\d 200/',$response['headers'])
replace withpreg_grep('/HTTP\/[\d\.]{1,3} 200/',$response['headers'])