-
Notifications
You must be signed in to change notification settings - Fork 375
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
Allow . in Netlify edge function paths #1082
Conversation
Now I see what's going on; edge functions shadow static assets, so with this PR as it stands all assets will be shadowed and served as 404s by the edge function instead. I didn't notice this at first because all the assets were cached, doh. Skipping the edge function for paths containing I'll keep digging and see if I can figure out a better compromise. |
I've added Static files in |
…unctions 1. Previously, all paths containing '.' we assumed to be static assets. - Now all paths are handled initially by our edge function. We manually call context.next() to see whether there's a matching static asset. 2. Previously, internal fetch() calls would only work for dynamic content. - We now normalize the URL and call Netlify's fetch() in all cases. Internal fetch() now works correctly for both static and dynamic content.
OK! This PR now covers all the following cases:
If you'd like me to put together a test, let me know. It's not really specific to Netlify so I guess the test wouldn't belong in this package. |
I think the case I'd want to check is top level wildcard routes.. classically having star routes like we do in the Hackernews example break when we don't put some sort of criteria in. |
Makes sense... I've deployed the HN sample using my solid-start-netlify branch here: iainmerrick/solid-start-edge-test#1 Looks like it's working correctly. I'll add a few routes to test those cases I listed. (I tried running the main solid-start integration test with |
Test routes:
|
Seems good to me thanks for testing |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When deploying as a Netlify edge function, it explicitly does not handle any paths containing a "." character.
These paths fall through to the default Netlify 404 page (not the project's own 404).
What is the new behavior?
All requests are handled by the edge function. If the project has its own 404 page, we don't ever see the default Netlify 404.
Other information
I've manually tested that this covers the following cases:
.
in name).
in name)fetch
of static asset (frompublic
)fetch
of dynamic routeIf you'd like me to put together a test, let me know. It's not really specific to Netlify so I guess it doesn't belong in this package.