-
Notifications
You must be signed in to change notification settings - Fork 89
scheme:/.//foo/bar is incorrectly normalized to scheme://foo/bar #262
Copy link
Copy link
Milestone
Description
Initially reported for the PHP project at php/php-src#19897.
This one is a little complicated, because the normalization itself is working correctly, it's that the stringification after normalization behaves incorrectly.
When patching the uriparse tool as follows:
--- i/tool/uriparse.c
+++ w/tool/uriparse.c
@@ -92,6 +92,8 @@ int main(int argc, char *argv[]) {
(long unsigned int)(state.errorPos - argv[i]));
retval = EXIT_FAILURE;
} else {
+ uriNormalizeSyntaxA(&uri);
+
if (uri.scheme.first) {
printf("scheme: %.*s\n", RANGE(uri.scheme));
}
to normalize a URI before printing the individual components, the normalized URI internally looks like:
uri: scheme:/.//foo/bar
scheme: scheme
.. pathSeg:
.. pathSeg: foo
.. pathSeg: bar
absolutePath: true
This then is stringified into scheme://foo/bar.
Reactions are currently unavailable