Skip to content

Commit 1e45a61

Browse files
jasnellrvagg
authored andcommitted
deps: update http-parser to version 1.2
Fixes http-parser regression with IS_HEADER_CHAR check Add test case for obstext characters (> 0x80) in header PR-URL: #5242 Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent 563c359 commit 1e45a61

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

deps/http_parser/http_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ enum http_host_state
388388
#endif
389389

390390
#define IS_HEADER_CHAR(ch) \
391-
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127))
391+
(ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
392392

393393
#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
394394

deps/http_parser/http_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern "C" {
2525
#endif
2626

2727
#define HTTP_PARSER_VERSION_MAJOR 1
28-
#define HTTP_PARSER_VERSION_MINOR 1
28+
#define HTTP_PARSER_VERSION_MINOR 2
2929

3030
#include <sys/types.h>
3131
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var common = require('../common');
2+
var http = require('http');
3+
var assert = require('assert');
4+
5+
var server = http.createServer(common.mustCall(function(req, res) {
6+
res.end('ok');
7+
}));
8+
server.listen(common.PORT, function() {
9+
http.get({
10+
port: common.PORT,
11+
headers: {'Test': 'Düsseldorf'}
12+
}, common.mustCall(function(res) {
13+
assert.equal(res.statusCode, 200);
14+
server.close();
15+
}));
16+
});

0 commit comments

Comments
 (0)