Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 954a4b4

Browse filesBrowse files
committed
deps: update to http-parser 2.6.2
Fixes http-parser regression with IS_HEADER_CHAR check Add test case for obstext characters (> 0x80) is header PR-URL: #5237 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent de91e9a commit 954a4b4
Copy full SHA for 954a4b4

File tree

Expand file treeCollapse file tree

5 files changed

+23
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+23
-5
lines changed
Open diff view settings
Collapse file

‎deps/http_parser/Makefile‎

Copy file name to clipboardExpand all lines: deps/http_parser/Makefile
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
2222
HELPER ?=
2323
BINEXT ?=
2424
ifeq (darwin,$(PLATFORM))
25-
SONAME ?= libhttp_parser.2.6.1.dylib
25+
SONAME ?= libhttp_parser.2.6.2.dylib
2626
SOEXT ?= dylib
2727
else ifeq (wine,$(PLATFORM))
2828
CC = winegcc
2929
BINEXT = .exe.so
3030
HELPER = wine
3131
else
32-
SONAME ?= libhttp_parser.so.2.6.1
32+
SONAME ?= libhttp_parser.so.2.6.2
3333
SOEXT ?= so
3434
endif
3535

Collapse file

‎deps/http_parser/http_parser.c‎

Copy file name to clipboardExpand all lines: deps/http_parser/http_parser.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ enum http_host_state
440440
* character or %x80-FF
441441
**/
442442
#define IS_HEADER_CHAR(ch) \
443-
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127))
443+
(ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))
444444

445445
#define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res)
446446

Collapse file

‎deps/http_parser/http_parser.h‎

Copy file name to clipboardExpand all lines: deps/http_parser/http_parser.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
/* Also update SONAME in the Makefile whenever you change these. */
2828
#define HTTP_PARSER_VERSION_MAJOR 2
2929
#define HTTP_PARSER_VERSION_MINOR 6
30-
#define HTTP_PARSER_VERSION_PATCH 1
30+
#define HTTP_PARSER_VERSION_PATCH 2
3131

3232
#include <sys/types.h>
3333
#if defined(_WIN32) && !defined(__MINGW32__) && \
Collapse file

‎deps/http_parser/test.c‎

Copy file name to clipboardExpand all lines: deps/http_parser/test.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3356,7 +3356,7 @@ test_double_content_length_error (int req)
33563356

33573357
parsed = http_parser_execute(&parser, &settings_null, buf, buflen);
33583358
if (parsed != buflen) {
3359-
assert(HTTP_PARSER_ERRNO(&parser) == HPE_MULTIPLE_CONTENT_LENGTH);
3359+
assert(HTTP_PARSER_ERRNO(&parser) == HPE_UNEXPECTED_CONTENT_LENGTH);
33603360
return;
33613361
}
33623362

Collapse file
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const http = require('http');
5+
const assert = require('assert');
6+
7+
const server = http.createServer(common.mustCall((req, res) => {
8+
res.end('ok');
9+
}));
10+
server.listen(common.PORT, () => {
11+
http.get({
12+
port: common.PORT,
13+
headers: {'Test': 'Düsseldorf'}
14+
}, common.mustCall((res) => {
15+
assert.equal(res.statusCode, 200);
16+
server.close();
17+
}));
18+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.