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 Pages Functions path routing on Windows #330

Closed
wants to merge 1 commit into from

Conversation

jahands
Copy link
Contributor

@jahands jahands commented Jan 28, 2022

This fixes an issue pointed out in #50 #51 where Pages Functions routes weren't properly routing due to Windows path separators being \\ instead of /. Tested this change on both Windows and Linux.

Before:

functions\api\example.js -> /apiexample
functions\api\[[path]].js -> /api:path*

After:

functions\api\example.js -> /api/example
functions\api\[[path]].js -> /api/:path*

Edit: This might be good to go ahead and push out for Windows users. But I really like #331 as a more permanent fix to issues like this.

@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2022

🦋 Changeset detected

Latest commit: 4b2b0d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JacobMGEvans
Copy link
Contributor

JacobMGEvans commented Jan 31, 2022

@petebacondarwin is working on an OS testing environment in the CI/CD (#329) which I think should go in before this. Then we can run the tests for this in the Windows environment.

petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this pull request Feb 1, 2022
Previously route paths were manipulated by file-system path utilities.
On Windows this resulted in URLs that had backslashes, which are invalid for such URLs.

Fixes cloudflare#51
Closes cloudflare#235
Closes cloudflare#330
Closes cloudflare#327
petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this pull request Feb 1, 2022
Previously route paths were manipulated by file-system path utilities.
On Windows this resulted in URLs that had backslashes, which are invalid for such URLs.

Fixes cloudflare#51
Closes cloudflare#235
Closes cloudflare#330
Closes cloudflare#327
petebacondarwin added a commit that referenced this pull request Feb 2, 2022
Previously route paths were manipulated by file-system path utilities.
On Windows this resulted in URLs that had backslashes, which are invalid for such URLs.

Fixes #51
Closes #235
Closes #330
Closes #327
@github-actions github-actions bot mentioned this pull request Feb 2, 2022
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.

2 participants