-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Errors with protocol-relative URLS (e.g. <img src="//example.com/image.jpg">) #27
Comments
The I'll file an issue in the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think this is still an issue |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I had one old html file in my site with the following bit:
That url is now dead, but the error that eleventy-plugin-img2picture gave me is:
That
ENOENT: no such file or directory, stat 'src/s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png'
is the wrong error for a remote URL - I believe it's not recognizing the//
at the beginning as a protocol-relative URL and therfore trying to treat it as a local file. (I haveeleventyInputDir: 'src'
in my config.)These are fairly rare these days, but they are still valid. The browser just makes it either http or https, whichever the page is.
Running
new URL('//example.com/image.jpg')
will throw, because it doesn't have enough context to know if it should use http or https. However, these work in a img src attribute, because the browser has that context.The text was updated successfully, but these errors were encountered: