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

Use module specifier algorithm for URLs #35

Open
RoyalIcing opened this issue May 31, 2018 · 0 comments
Open

Use module specifier algorithm for URLs #35

RoyalIcing opened this issue May 31, 2018 · 0 comments
Assignees

Comments

@RoyalIcing
Copy link
Member

  1. Apply the URL parser to specifier. If the result is not failure, return the result.
  2. If specifier does not start with the character U+002F SOLIDUS (/), the two-character sequence U+002E FULL STOP, U+002F SOLIDUS (./), or the three-character sequence U+002E FULL STOP, U+002E FULL STOP, U+002F SOLIDUS (../), return failure.

The following are valid module specifiers according to the above algorithm:

https://example.com/apples.js
http:example.com\pears.mjs (becomes http://example.com/pears.mjs as step 1 parses with no base URL)
//example.com/bananas
./strawberries.js.cgi
../lychees
/limes.jsx
data:text/javascript,export default 'grapes';
blob:https://whatwg.org/d0360e2f-caee-469f-9a2f-87d5b0456f6f

The following are valid module specifiers according to the above algorithm, but will invariably cause failures when they are fetched:

javascript:export default 'artichokes';
data:text/plain,export default 'kale';
about:legumes
wss://example.com/celery

The following are not valid module specifiers according to the above algorithm:

https://eggplant:b/c
pumpkins.js
.tomato
..zucchini.js
.\yam.es
@RoyalIcing RoyalIcing self-assigned this May 31, 2018
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

No branches or pull requests

1 participant