Don't consider nonexistant files as static #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #209.
pathname
when deciding whether a request should be handled statically.I'm pretty sure that the first fix, where we no longer regard the query string when examining what to do with a path, is good and correct.
However, having implemented the behavior where we only consider serving a file statically if it actually exists, I'm not sure how I actually like it. This behavior means we serve a 200 with a gibberish response on any incorrect path to an asset, which makes certain problems harder to find. On the other hand, it doesn't seem unreasonable for an Elm application to want to masquerade as e.g. ASP.NET or PHP, in which case it might want to serve URLs that end in e.g.
.aspx
or.php
. It might make sense to carve out exceptions for certain well-known file types such as CSS, JS,.ico
,.png
,.jpg
, or alternately revert this behavior entirely and make people like me put email addresses as query string arguments instead of paths. Thoughts?