Skip to content
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

fix: how cloudflare pages adapter checks for static asset request and give start a chance to handle request if not found #998

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

edivados
Copy link
Contributor

@edivados edivados commented Aug 12, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

There were actually two bugs:

  • The complete url is used to check for file endings causing 404 if the url ends with a query param that looks like a file ending.
    http://localhost?test=bad.png would causes 404.
  • If the request for the static asset returns anything other than 200 the cloudflare error page will be shown instead of letting solid-start handle the request.

What is the new behavior?

  • Only looking at the pathname for file ending.
  • If the request for static asset does not return 200 or 304 solid-start handels the request.

Other information

fixes #963

@edivados edivados changed the title fix: cloudflare pages adapter looking for file ending in query params fix: cloudflare pages adapter looking for file ending in query params and passing the request to solid-start Aug 12, 2023
@edivados edivados changed the title fix: cloudflare pages adapter looking for file ending in query params and passing the request to solid-start fix: cloudflare pages adapter looking for file ending in query params and also not passing the request to solid-start on non 200 Aug 12, 2023
@edivados edivados changed the title fix: cloudflare pages adapter looking for file ending in query params and also not passing the request to solid-start on non 200 fix: cloudflare pages adapter checking for static asset request and give start a chance to handle request if not found Aug 13, 2023
@edivados edivados changed the title fix: cloudflare pages adapter checking for static asset request and give start a chance to handle request if not found fix: how cloudflare pages adapter checks for static asset request and give start a chance to handle request if not found Aug 13, 2023
@ryansolid ryansolid merged commit 2277668 into solidjs:main Aug 14, 2023
9 checks passed
@ryansolid
Copy link
Member

Thanks

@edivados edivados deleted the cloudflare-pages-regex branch August 14, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: Cloudflare 404 error when last query param contains a "."
2 participants