Skip to content

Bug?: InvalidURL error when resolving relative paths that go above domain root #1093

@cold01water

Description

@cold01water

Summary

The stitch function in the URL handling code returns InvalidURL when trying to resolve relative paths containing ../ that would navigate above the domain root. This causes issues when fetching web pages with relative resource links.

Steps to Reproduce

This is a real URL

  1. Try to resolve a relative path like ../static/bootstrap.min.css with base URL https://alas.aws.amazon.com/alas2.html
  2. The function returns InvalidURL error

Expected Behavior

The function should resolve the path to https://alas.aws.amazon.com/static/bootstrap.min.css (staying at domain root), similar to how other web browsers handle such cases.

Note: The ../ specification that goes beyond the domain root is incorrect, but there are surely countless sites like this.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions