Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: fix http-parser regression (v0.12) #5241

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/http_parser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# IN THE SOFTWARE.

PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
SONAME ?= libhttp_parser.so.2.3.1
SONAME ?= libhttp_parser.so.2.3.2

CC?=gcc
AR?=ar
Expand Down
2 changes: 1 addition & 1 deletion deps/http_parser/http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ enum http_host_state
* character or %x80-FF
**/
#define IS_HEADER_CHAR(ch) \
(ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127))
(ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127))

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

Expand Down
2 changes: 1 addition & 1 deletion deps/http_parser/http_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 3
#define HTTP_PARSER_VERSION_PATCH 1
#define HTTP_PARSER_VERSION_PATCH 2

#include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
Expand Down
18 changes: 18 additions & 0 deletions test/simple/test-http-header-obstext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

var common = require('../common');
var http = require('http');
var assert = require('assert');

var server = http.createServer(common.mustCall(function(req, res) {
res.end('ok');
}));
server.listen(common.PORT, function() {
http.get({
port: common.PORT,
headers: {'Test': 'Düsseldorf'}
}, common.mustCall(function(res) {
assert.equal(res.statusCode, 200);
server.close();
}));
});