LibURL/Pattern: Do not trim whitespace interpreting port

It turns out that the problem here was simply that we were trimming
trailing whitespace when we did not need to, which was meaning that
the port number of '80 ' was being converted to the empty string
per URLPattern elision as the port matches the http scheme.
This commit is contained in:
Shannon Booth 2025-04-07 11:24:01 +12:00 committed by Tim Flynn
commit 565ccc04a9
Notes: github-actions[bot] 2025-04-07 14:30:25 +00:00
2 changed files with 4 additions and 4 deletions

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 354 tests
351 Pass
3 Fail
352 Pass
2 Fail
Pass Loading data...
Pass Pattern: [{"pathname":"/foo/bar"}] Inputs: [{"pathname":"/foo/bar"}]
Pass Pattern: [{"pathname":"/foo/bar"}] Inputs: [{"pathname":"/foo/ba"}]
@ -170,7 +170,7 @@ Pass Pattern: [{"pathname":":
Pass Pattern: [{"port":""}] Inputs: [{"protocol":"http","port":"80"}]
Pass Pattern: [{"protocol":"http","port":"80"}] Inputs: [{"protocol":"http","port":"80"}]
Pass Pattern: [{"protocol":"http","port":"80{20}?"}] Inputs: [{"protocol":"http","port":"80"}]
Fail Pattern: [{"protocol":"http","port":"80 "}] Inputs: [{"protocol":"http","port":"80"}]
Pass Pattern: [{"protocol":"http","port":"80 "}] Inputs: [{"protocol":"http","port":"80"}]
Pass Pattern: [{"protocol":"http","port":"100000"}] Inputs: [{"protocol":"http","port":"100000"}]
Pass Pattern: [{"port":"80"}] Inputs: [{"protocol":"http","port":"80"}]
Pass Pattern: [{"protocol":"http{s}?","port":"80"}] Inputs: [{"protocol":"http","port":"80"}]