Skip to content

URLs containing no host and a path starting with ./ or ../ are not serialized idempotently #601

Closed
@jdm

Description

@jdm

Parsing a url like scheme:/.//path internally removes the ./ in the serialization (per the spec), so parsing the serialized URL of scheme://path yields a URL that is parsed differently than the original one (ie. path is treated as a host now, instead of part of the URL's path).

Cases to consider:

  • scheme:/.//path
  • scheme:/..//path
  • scheme:/./..//path (any leading mixed collection of ./ and ../)

My reading of the spec is that this might be a shortcoming that needs to be addressed there, rather than just an implementation bug. I can envision a couple possible solutions:

  • don't truncate ./ or ../ if it's the first component of a path, avoiding the issue entirely
  • truncate / when the previous segment is empty (resulting in scheme:/path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions