Title: The first path segment is unexpectedly interpreted as an authority after normalization · Issue #85 · python-hyper/rfc3986 · GitHub
Open Graph Title: The first path segment is unexpectedly interpreted as an authority after normalization · Issue #85 · python-hyper/rfc3986
X Title: The first path segment is unexpectedly interpreted as an authority after normalization · Issue #85 · python-hyper/rfc3986
Description: scheme:/..///bar has scheme="scheme", authority=None, path=/..///bar. However, after normalization, it has scheme="scheme", authority="bar". Consider t1 as an IRI ..///bar resolved against scheme:. t1 should have scheme="scheme" and auth...
Open Graph Description: scheme:/..///bar has scheme="scheme", authority=None, path=/..///bar. However, after normalization, it has scheme="scheme", authority="bar". Consider t1 as an IRI ..///bar resolved against scheme:....
X Description: scheme:/..///bar has scheme="scheme", authority=None, path=/..///bar. However, after normalization, it has scheme="scheme", authority="bar". Consider t1 as an IRI ..//...
Opengraph URL: https://github.com/python-hyper/rfc3986/issues/85
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The first path segment is unexpectedly interpreted as an authority after normalization","articleBody":"* `scheme:/..///bar` has scheme=`\"scheme\"`, authority=`None`, path=`/..///bar`.\r\n However, after normalization, it has scheme=`\"scheme\"`, authority=`\"bar\"`.\r\n* Consider t1 as an IRI `..///bar` resolved against `scheme:`.\r\n t1 should have scheme=`\"scheme\"` and authority=`None` (since `..///bar` does not contain authority).\r\n However, resulting string is `scheme://bar`, it has authority=`bar`.\r\n\r\nAnd some more examples:\r\n\r\n```\r\n$ python\r\nPython 3.9.9 (main, Jan 10 2022, 18:52:39)\r\n[GCC 11.2.1 20211127] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from rfc3986 import uri_reference\r\n>>> b = uri_reference('scheme:')\r\n>>> r1 = uri_reference('..///bar')\r\n>>> t1 = r1.resolve_with(b)\r\n>>> t1\r\nURIReference(scheme='scheme', authority=None, path='//bar', query=None, fragment=None)\r\n>>> t1.unsplit()\r\n'scheme://bar'\r\n>>> r2 = uri_reference('/..///bar')\r\n>>> r2.resolve_with(b)\r\nURIReference(scheme='scheme', authority=None, path='//bar', query=None, fragment=None)\r\n>>> uri_reference('scheme:/..///bar').normalize()\r\nURIReference(scheme='scheme', authority=None, path='//bar', query=None, fragment=None)\r\n>>> uri_reference('scheme:/..///bar').normalize().unsplit()\r\n'scheme://bar'\r\n```\r\n\r\nI'm not sure how this should handled.\r\nCollapsing the `//` at the beginning is not explicitly allowed by RFC 3986, so I think the normalization and the resolution cannot produce valid output and should fail in this case.\r\n(But RFC 3986 does not seem to state that they can fail!)\r\n\r\nThis can caused by normalization during resolution, so #84 may also be affected by this issue.","author":{"url":"https://github.com/lo48576","@type":"Person","name":"lo48576"},"datePublished":"2022-01-10T12:33:58Z","url":"https://github.com/python-hyper/rfc3986/issues/85"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:42d77b26-6277-ee1a-6c7f-a762be188ab8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95C2:B1B84:4164427:52F22D7:6B025FA3 |
| html-safe-nonce | 04799b93587425f26da6b37bfe752608d1f3995e20372d968e2552afadeda426 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUMyOkIxQjg0OjQxNjQ0Mjc6NTJGMjJENzo2QjAyNUZBMyIsInZpc2l0b3JfaWQiOiIyMjk4ODQzMjc1MTczNDUzNzMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3e4e0e80ef77c54afb53f202865ee24552b794d900f786c4ec8c2fd8a8dfb28f |
| hovercard-subject-tag | issue:1097846843 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/rfc3986/85/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d7817dc6fc1f3a56a04de27467e2b195e10d3e8faa044226e8e45d29e37596d9/python-hyper/rfc3986/issues/85 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d7817dc6fc1f3a56a04de27467e2b195e10d3e8faa044226e8e45d29e37596d9/python-hyper/rfc3986/issues/85 |
| og:image:alt | scheme:/..///bar has scheme="scheme", authority=None, path=/..///bar. However, after normalization, it has scheme="scheme", authority="bar". Consider t1 as an IRI ..///bar resolved against scheme:.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lo48576 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/rfc3986 git https://github.com/python-hyper/rfc3986.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 21205959 |
| octolytics-dimension-repository_nwo | python-hyper/rfc3986 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21205959 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/rfc3986 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width