Skip to content

Commit 5e420e6

Browse files
test: name two more parsed-path spellings the surgery never sees
The redactor suite's not-an-authority list gains a path-absolute reference (`/http://user:secret@h/p`, which the parser accepts as a path and the relative route writes back) and a `/ /` that is not a `//` (P5-100, P5-107): both surfaced by re-running review round 2's battery against the repaired redactor, and both are what RFC 3986 decides rather than what the surgery pattern reaches.
1 parent b3c9788 commit 5e420e6

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎gems/dexpace-core/test/dexpace/instrumentation/redactor_test.rb‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,13 @@ class SurgeryRouteTest < DexpaceTestCase
343343
# What is still not an authority under RFC 3986 and is written back as given (P5-100):
344344
# no `//` before the `@` (a path or an opaque part, and only a proxy URL's own grammar
345345
# can call it a credential -- the resolver's belt, P5-103), the backslash spellings (a
346-
# backslash is not a URI character), and what the parser ACCEPTS without an authority --
347-
# an empty authority with the credential in the path, a network-path reference that
348-
# splits as a path -- which never reaches the surgery route at all.
346+
# backslash is not a URI character), a `/ /` that is not a `//`, and what the parser
347+
# ACCEPTS without an authority -- an empty authority with the credential in the path, a
348+
# path-absolute reference, a network-path reference that splits as a path -- which never
349+
# reaches the surgery route at all.
349350
["user:secret@h/p", "http:\\\\user:secret@h\\p", "\\\\user:secret@h/p",
350-
"http:///user:secret@h/p", "//@user:secret@h/x",].each do |value|
351+
"http:/ /user:secret@h/p", "http:///user:secret@h/p", "/http://user:secret@h/p",
352+
"//@user:secret@h/x",].each do |value|
351353
assert_equal(value, Redactor::DEFAULT.header_value("Location", value))
352354
end
353355
# A parseable URL whose PATH spells a second authority is a valid URI, and OBS-14 forbids

0 commit comments

Comments
 (0)