Skip to content

fix: use rawUrl for path #954

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

Merged
merged 2 commits into from
Dec 10, 2021
Merged

fix: use rawUrl for path #954

merged 2 commits into from
Dec 10, 2021

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Dec 9, 2021

Summary

Netlify Functions events have a bug where the event.path is decoded, so can end up with illegal characters. To work around this, this PR switches to using rawUrl directly, which is still encoded. This bug was manifesting when a URL contained an encoded # character, which if decoded would cause the rest of the URL to be treated as a fragment rather than part of the path.

Test plan

  1. Visit the Deploy Preview (on this page)
  2. Verify the path displayed in the page includes the # character (%23)

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

image

Fixes #952

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Dec 9, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-demo ready!

🔨 Explore the source changes: 9883791

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/61b32d88b5b77300074075ba

😎 Browse the preview: https://deploy-preview-954--netlify-plugin-nextjs-demo.netlify.app

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Dec 9, 2021
@netlify
Copy link

netlify bot commented Dec 9, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

🔨 Explore the source changes: 9883791

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/61b32d880b01d7000952d244

😎 Browse the preview: https://deploy-preview-954--netlify-plugin-nextjs-static-root-demo.netlify.app

@netlify
Copy link

netlify bot commented Dec 9, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

🔨 Explore the source changes: 9883791

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/61b32d8889d0a00008c6f74d

😎 Browse the preview: https://deploy-preview-954--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app/

@cypress
Copy link

cypress bot commented Dec 9, 2021



Test summary

16 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit ed197d4
Started Dec 9, 2021 8:36 PM
Ended Dec 9, 2021 8:39 PM
Duration 02:44 💡
OS Linux Ubuntu - 20.04
Browser Custom chromium 90

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

fix: wip path encoding

chore: log event

chore: use rawurl

chore: use rawurl
@ascorbic ascorbic changed the title fix: wip path encoding fix: use rawUrl for path Dec 9, 2021
@ascorbic ascorbic self-assigned this Dec 10, 2021
@ascorbic ascorbic requested a review from tiffafoo December 10, 2021 09:45
@ascorbic ascorbic marked this pull request as ready for review December 10, 2021 09:45
Copy link

@tiffafoo tiffafoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the url adds %23. Great fix!

@kodiakhq kodiakhq bot merged commit b2f8f5b into main Dec 10, 2021
@kodiakhq kodiakhq bot deleted the mk/encoding-path branch December 10, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enterprise escalation]: Certain types of encoded URL's are processed incorrectly; everything after the encoded character gets cut off
2 participants