Skip to content

Commit 4ab1626

Browse files
authored
fixing issue 970 (#974)
1 parent ec6a44b commit 4ab1626

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/checkers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ static constexpr std::array<uint8_t, 256> path_signature_table =
6767
std::array<uint8_t, 256> result{};
6868
for (size_t i = 0; i < 256; i++) {
6969
if (i <= 0x20 || i == 0x22 || i == 0x23 || i == 0x3c || i == 0x3e ||
70-
i == 0x3f || i == 0x60 || i == 0x7b || i == 0x7d || i > 0x7e) {
70+
i == 0x3f || i == 0x5e || i == 0x60 || i == 0x7b || i == 0x7d ||
71+
i > 0x7e) {
7172
result[i] = 1;
7273
} else if (i == 0x25) {
7374
result[i] = 8;

tests/basic_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,10 @@ TYPED_TEST(basic_tests, test_issue_935) {
516516
ASSERT_EQ(no_dot->get_pathname(), "/foo/bar/baz.js");
517517
SUCCEED();
518518
}
519+
520+
TYPED_TEST(basic_tests, test_issue_970) {
521+
auto url = ada::parse<TypeParam>("http://foo/bar^baz");
522+
ASSERT_TRUE(url);
523+
ASSERT_EQ(url->get_pathname(), "/bar%5Ebaz");
524+
SUCCEED();
525+
}

0 commit comments

Comments
 (0)