diff --git a/src/checkers.cpp b/src/checkers.cpp index 346c474fe..0a557ac25 100644 --- a/src/checkers.cpp +++ b/src/checkers.cpp @@ -67,7 +67,8 @@ static constexpr std::array path_signature_table = std::array result{}; for (size_t i = 0; i < 256; i++) { if (i <= 0x20 || i == 0x22 || i == 0x23 || i == 0x3c || i == 0x3e || - i == 0x3f || i == 0x60 || i == 0x7b || i == 0x7d || i > 0x7e) { + i == 0x3f || i == 0x5e || i == 0x60 || i == 0x7b || i == 0x7d || + i > 0x7e) { result[i] = 1; } else if (i == 0x25) { result[i] = 8; diff --git a/tests/basic_tests.cpp b/tests/basic_tests.cpp index 307855d19..8e1fb1fbd 100644 --- a/tests/basic_tests.cpp +++ b/tests/basic_tests.cpp @@ -516,3 +516,10 @@ TYPED_TEST(basic_tests, test_issue_935) { ASSERT_EQ(no_dot->get_pathname(), "/foo/bar/baz.js"); SUCCEED(); } + +TYPED_TEST(basic_tests, test_issue_970) { + auto url = ada::parse("http://foo/bar^baz"); + ASSERT_TRUE(url); + ASSERT_EQ(url->get_pathname(), "/bar%5Ebaz"); + SUCCEED(); +}