From 1e19a41bd4c8486525294eada609c93e3d84d95d Mon Sep 17 00:00:00 2001 From: Andrew Kistler Date: Thu, 8 Sep 2022 16:37:26 -0400 Subject: [PATCH] Fix a sanity check. It is valid to have an empty port. In order to accomodate the URL: http://http:%2f%2fhttp:%2f%2f@http://http://?http://#http:// --- third-party/url-parser/url_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/url-parser/url_parser.c b/third-party/url-parser/url_parser.c index 4912ee20..db8c7394 100644 --- a/third-party/url-parser/url_parser.c +++ b/third-party/url-parser/url_parser.c @@ -512,10 +512,10 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { case s_http_host_v6: case s_http_host_v6_zone_start: case s_http_host_v6_zone: - case s_http_host_port_start: case s_http_userinfo: case s_http_userinfo_start: return 1; + case s_http_host_port_start: /* Valid to have a blank port. see RFC3986 section 3.2.3 */ default: break; }