-
Notifications
You must be signed in to change notification settings - Fork 24
port pattern canonicalization seems wrong after all #260
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
Comments
You're right. The spec should mention trim c0 whitespace before checking if protocol's port is equal to port. Here's the Ada implementation that follows the test but fails to follow the specification: // If processedInit["protocol"] is a special scheme and processedInit["port"]
// is a string which represents its corresponding default port in radix-10
// using ASCII digits then set processedInit["port"] to the empty string.
// TODO: Optimization opportunity.
if (scheme::is_special(*processed_init->protocol)) {
std::string_view port = processed_init->port.value();
helpers::trim_c0_whitespace(port);
if (std::to_string(scheme::get_special_port(*processed_init->protocol)) ==
port) {
processed_init->port->clear();
}
} I recommend adding trim whitespace behavior to the spec itself. |
Yeah I believe the current wpt is the intuitive behavior for developers. Maybe we can add the step removing c0 whitespace from the input in https://urlpattern.spec.whatwg.org/#process-port-for-init. |
For whatwg/urlpattern#260 (port) and whatwg/urlpattern#252 (hostname).
For whatwg/urlpattern#260 (port) and whatwg/urlpattern#252 (hostname).
This has been resolved in web-platform-tests/wpt#51316 based on a discussion in #261. |
…lated test, a=testonly Automatic update from web-platform-tests URLPattern: correct port and hostname-related test For whatwg/urlpattern#260 (port) and whatwg/urlpattern#252 (hostname). -- wpt-commits: a8c62524f649ca5fa69e0f7411f16955edadb851 wpt-pr: 51316
…lated test, a=testonly Automatic update from web-platform-tests URLPattern: correct port and hostname-related test For whatwg/urlpattern#260 (port) and whatwg/urlpattern#252 (hostname). -- wpt-commits: a8c62524f649ca5fa69e0f7411f16955edadb851 wpt-pr: 51316
…lated test, a=testonly Automatic update from web-platform-tests URLPattern: correct port and hostname-related test For whatwg/urlpattern#260 (port) and whatwg/urlpattern#252 (hostname). -- wpt-commits: a8c62524f649ca5fa69e0f7411f16955edadb851 wpt-pr: 51316
What is the issue with the URL Pattern Standard?
I'd like to revisit #239. cc @anonrig
The expectation of this test is that the port gets elided because 80 is the default port for "
http
".This is the set of steps:
cc @jeremyroman cc @sisidovski
The text was updated successfully, but these errors were encountered: