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

Fixed routes with same paths but different methods from being overwritten on Windows #465

Closed
wants to merge 9 commits into from
5 changes: 5 additions & 0 deletions .changeset/hungry-pugs-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Fixed routes with same methods being overriden on Windows(?)
4 changes: 3 additions & 1 deletion packages/wrangler/pages/functions/filepath-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export async function generateConfigFromFileTree({
routeEntries = routeEntries.reduce(
(acc: typeof routeEntries, { routePath, ...rest }) => {
const existingRouteEntry = acc.find(
(routeEntry) => routeEntry.routePath === routePath
(routeEntry) =>
routeEntry.routePath === routePath &&
routeEntry.method === rest.method
);
if (existingRouteEntry !== undefined) {
Object.assign(existingRouteEntry, rest);
Expand Down