Skip to content

Commit 0b1e6e4

Browse files
committed
Updating change to http_parser to reflect PR for nodejs/http-parser
The parser now also supports digits, '-' and '.'. nodejs/http-parser#276
1 parent 0c1f567 commit 0b1e6e4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deps/http-parser/http_parser.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ do { \
9999
FOR##_mark = NULL; \
100100
} \
101101
} while (0)
102-
102+
103103
/* Run the data callback FOR and consume the current byte */
104104
#define CALLBACK_DATA(FOR) \
105105
CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1)
@@ -444,14 +444,17 @@ parse_url_char(enum state s, const char ch)
444444
return s_req_path;
445445
}
446446

447+
/* The schema must start with an alpha character. After that, it may
448+
* consist of digits, '+', '-' or '.', followed by a ':'.
449+
*/
447450
if (IS_ALPHA(ch)) {
448451
return s_req_schema;
449452
}
450453

451454
break;
452455

453456
case s_req_schema:
454-
if (IS_ALPHA(ch) || ch == '+') {
457+
if (IS_ALPHANUM(ch) || ch == '+' || ch == '-' || ch == '.') {
455458
return s;
456459
}
457460

0 commit comments

Comments
 (0)