diff --git a/include/upa/url.h b/include/upa/url.h index 88d08c9..5202089 100644 --- a/include/upa/url.h +++ b/include/upa/url.h @@ -1982,10 +1982,11 @@ inline validation_errc url_parser::url_parse(url_serializer& urls, const CharT* urls.clear_part(url::PORT); } } - } - // 2.2. If state override is given, then return - if (state_override) - return validation_errc::ok; + // 2.2. If state override is given, then return + if (state_override) + return validation_errc::ok; + } else if (state_override) + return validation_errc::ignored; state = path_start_state; pointer = end_of_digits; } else { diff --git a/test/test-url-setters.cpp b/test/test-url-setters.cpp index 50ac64c..8fb8eec 100644 --- a/test/test-url-setters.cpp +++ b/test/test-url-setters.cpp @@ -49,6 +49,10 @@ TEST_CASE("Test setters with special URL's") { CHECK_EQ(url.host(), "example.net:88"); CHECK_EQ(url.port_int(), 88); + CHECK(url.port("90=")); + CHECK_FALSE(url.port("abc")); + CHECK_EQ(url.port_int(), 90); + CHECK(url.port("")); CHECK_EQ(url.host(), "example.net");