serve-handler
serve-handler copied to clipboard
Enable support for slashes in regex when doing a rewrite.
serve.json
:
{
"rewrites": [
{
"source": "foo/:rest*",
"destination": "/:rest*"
}
]
}
If we were to query localhost:5000/foo/bar/quz/cux.json
fallback
would end up being /bar%2Fquz%2Fcux.json
which is never found by the stat
function.
This commit fixes that.
Why did I do this?
I have a site hosted at http://foo.com/bar
, which is actually a reverse proxy to a container running zeit/serve
. zeit/serve
doesn't know that it's supposed to discard bar
, as it thinks it's at the root.
Now with the rewrite, that is fixed.
Edit: this seems to be triggering some errors. Let me find out why.
Bump