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
{{ message }}
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
Because the linked files have the prefix images, and are served from the /images URL, they need to be addressed as http://.../images/images/cassowary.jpg. This is surprising; and vexing, because when the dev is testing against their local filesystem, the files won't have the double prefix.
We should consider options for making this less surprising and less vexing, ideally "intelligently" (that is, without requiring the developer to specify their desired behaviour) while still predictably. We may also need to support an override for when our intelligent behaviour turns out to be stupid after all.
Currently I am thinking of the rule:
If you are in a wildcard route, and any prefix of a files pattern matches the route prefix, then that prefix is dropped.
This works nicely for typical static file serving cases. However I would like to talk more about possible other cases where this might break down, or is surprising. For example, what would you expect to happen here"
I am not sure I follow "if the developer is testing against their local filesystem". How are they testing locally such that the URL would resolve? We had talked about the hippofactory --prepare ... && wagi --standalone-bindle thing, but that would definitely resolve the path correctly.
I was thinking about native debug situations (since Wasm debugging remains not great). But yeah, maybe that consideration is irrelevant.
Nevertheless, it still feels like writing /images/images/foo.jpg in your HTML when there is no images/images path anywhere in the project structure feels gesticulates vaguely wrong, at least to me...
Probably a generic path rewriting, perhaps via regexp, would be the most flexible. See, for example, mod_rewrite for an example of how Apache dealt with this, or the rewrite directive in nginx, which looks like this:
Consider the following handler:
Because the linked files have the prefix
images
, and are served from the/images
URL, they need to be addressed ashttp://.../images/images/cassowary.jpg
. This is surprising; and vexing, because when the dev is testing against their local filesystem, the files won't have the double prefix.We should consider options for making this less surprising and less vexing, ideally "intelligently" (that is, without requiring the developer to specify their desired behaviour) while still predictably. We may also need to support an override for when our intelligent behaviour turns out to be stupid after all.
Currently I am thinking of the rule:
files
pattern matches the route prefix, then that prefix is dropped.This works nicely for typical static file serving cases. However I would like to talk more about possible other cases where this might break down, or is surprising. For example, what would you expect to happen here"
What about scenarios other than static file serving?
The text was updated successfully, but these errors were encountered: