Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how HTTP header fields integrate with URL patterns #230

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

jeremyroman
Copy link
Collaborator

@jeremyroman jeremyroman commented Aug 28, 2024

Per discussion on #182 some text explaining this would be useful.

This mostly consists of advice since the useful algorithms are already exposed.

  • At least two implementers are interested (and none opposed):
    • Chromium
    • WebKit
  • Tests are written and can be reviewed and commented upon at:
    • n/a (tests would apply to any such header, not to this text itself)
  • Implementation bugs are filed: n/a
  • MDN issue is filed: n/a
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

Per discussion on whatwg#182 some text explaining this would be useful.
@jeremyroman
Copy link
Collaborator Author

@domenic @annevk does this address the concern in #182 (comment)?

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with editorial nit.

spec.bs Outdated Show resolved Hide resolved
Co-authored-by: Domenic Denicola <[email protected]>
spec.bs Outdated
@@ -2049,6 +2054,24 @@ If a specification has an Infra value (e.g., after using [=parse a JSON string t

Specifications may wish to leave room in their formats to accept options for {{URLPatternOptions}}, override the base URL, or similar, since it is not possible to construct a {{URLPattern}} object directly in this case, unlike in a JavaScript API. For example, <cite>Speculation Rules</cite> accepts a "`relative_to`" key which can be used to switch to using the [=document base URL=] instead of the JSON resource's URL. [[SPECULATION-RULES]]

<h3 id=other-specs-http>Integrating with HTTP header fields</h3>

HTTP headers which include URL patterns should accept a string in the constructor string syntax, likely as part of a structured field [[RFC8941]].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "constructor string syntax"? Is this talking about the URLPattern constructor which it below says should not be relied upon?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It refers to the syntax that is accepted when a single string is passed to the constructor (i.e., is accepted by the constructor string parser), as opposed to the pattern syntax for a single component.

It could be renamed something else, but this is how the spec currently refers to that syntax.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if the syntax is defined somewhere and you can xref it that seems reasonable. Otherwise it seems rather opaque to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added links to the constructor string parsing section.

@jeremyroman jeremyroman merged commit b45203d into whatwg:main Sep 27, 2024
2 checks passed
@jeremyroman jeremyroman deleted the http-integration branch September 27, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants