-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Handling of urls which don't have file extension #702
Comments
I agree |
I assume we will want the privileged to resolve the extension? If it does, and the |
Related question. Unlike scripts, modules must be served with a valid JavaScript MIME type in the browser, otherwise they won't be executed ( Should deno replicate this behavior in some way? For example, if |
It definitely makes sense to me to have the Content-Type as the content type preference, followed by the file extension. And to throw when neither provides a strong indicator. |
@MarkTiedemann Yes I think so. Currently we don't look at content-type. |
I think we should not even check for the extension, at least in the Unix world extension means nothing, we only have to check |
@qti3e I disagree that the extension of a file "means nothing". Yes, extensions are arbitrary in a way, but they are also hints for programs what kind of content is to be expected within a file. For example, many (but not all) programs (and humans) expect @guybedford I don't think the content type should take precedence over the extension. Instead, I'd propose the following:
|
@MarkTiedemann one can add
|
@aduh95 I think that's very confusing, and should be avoided. |
Ok... let me disagree with you on that, in the file-system world there is nothing stronger than the magic number of a file which is mostly the first bytes of the content itself, every real binary file format like Also, the file extension is not for computers, but it's for humans, and if you suppose a file extension to have some significant meaning, it's not for machines and systems, and it's only there for us (as humans). Our responsibility as system designers and library developers is to design for computers in the first degree and let other developers develop for other developers! So basically we should exclusively ignore a file extension while dealing with remote files. (I'm not sure about local imports) The classic captcha was a good example when we had a |
Exactly my point. |
Related to #859. |
I am working on this now. We also need to consider resolving local media types as well being determined in the privileged side, so the compiler does not rely upon file extensions at all. |
Bumped versions for 0.275.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Currently deno doesn't seem handling a url which doesn't have a file extension. However browsers seem working with such urls.
I think deno should handle those urls as JavaScript because that's more browser compatible and because it allows deno to work with https://dev.jspm.io. If deno works with jspm.io, I think it enables a lot of more meaningful experiments which depends on npm modules.
The text was updated successfully, but these errors were encountered: