You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I have a registration flow that takes the user to a URL like http://localhost:8080/awaiting-confirmation/[email protected]. Doing pushUrl from the Elm side works fine. However, refreshing this page in the browser causes an error: Cannot GET /awaiting-confirmation/[email protected].
I believe this is due to the code here that analyzes the URL to determine what file type the request is trying to get, in order to determine whether to try to serve a static file or to serve the root page:
Because this is guessing based on the "extension", any URL that ends in .com is assumed to be a static file.
At first I thought this was a problem with the URL parsing in the path component of a URL, so I also tried as a query string: http://localhost:8080/[email protected]. Unfortunately this gave me the same result (Cannot GET /awaiting-confirmation). I don't like the behavior on just paths, but I think the same behavior on query parameters is definitely wrong.
I can think of a few ways we could try to fix this:
Instead of guessing that the path is static because of its mimetype, we could assume any path that we can stat() successfully is static.
We could be more opinionated about insisting that static assets be located under certain well-known directories such as public or static.
The text was updated successfully, but these errors were encountered:
This is a very good point and something that I didn't have a lot of cases to test the edges of. Would love your thoughts on solutions for this in the code. :)
In my project, I have a registration flow that takes the user to a URL like
http://localhost:8080/awaiting-confirmation/[email protected]
. DoingpushUrl
from the Elm side works fine. However, refreshing this page in the browser causes an error:Cannot GET /awaiting-confirmation/[email protected]
.I believe this is due to the code here that analyzes the URL to determine what file type the request is trying to get, in order to determine whether to try to serve a static file or to serve the root page:
elm-live/lib/src/start.js
Lines 109 to 110 in e9af6ec
Because this is guessing based on the "extension", any URL that ends in
.com
is assumed to be a static file.At first I thought this was a problem with the URL parsing in the path component of a URL, so I also tried as a query string:
http://localhost:8080/[email protected]
. Unfortunately this gave me the same result (Cannot GET /awaiting-confirmation
). I don't like the behavior on just paths, but I think the same behavior on query parameters is definitely wrong.I can think of a few ways we could try to fix this:
stat()
successfully is static.public
orstatic
.The text was updated successfully, but these errors were encountered: