Skip to content
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

Handle URLs without scheme #118

Merged
merged 2 commits into from
Aug 22, 2021
Merged

Handle URLs without scheme #118

merged 2 commits into from
Aug 22, 2021

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Aug 22, 2021

There exists currently special handling for URLs that begin with http:// and https://, but not for URLs that begin with // (ie, which have no scheme). When magepack encounters a URL such as //unpkg.com/jquery it does not recognise this as an external asset. This pull request adds handling for the scheme-less URL format.

While I think it's better to always include a scheme, it is technically valid and has been suggested / recommended by some to omit the scheme. Without a scheme specified, the user agent will use the scheme of the current document, so a http:// page parsing //www.example.net/ will result in http://www.example.net/, and a https:// page parsing //www.example.org/ will result in https://www.example.org/.

@krzksz krzksz merged commit d51be93 into magesuite:master Aug 22, 2021
@fredden fredden deleted the no-scheme branch August 22, 2021 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants