fix(next-routing): denormalize data URLs in standalone dynamic route check#91620
Draft
haltandcatchwater wants to merge 1 commit intovercel:canaryfrom
Draft
Conversation
…e matching The standalone dynamic route check after afterFiles processing used an inline loop that did not denormalize data URLs before matching. The checkDynamicRoutes helper, which is already used for the afterFiles and fallback code paths, handles this correctly via its denormalization preamble. Replace the inline loop with a call to checkDynamicRoutes to fix potential silent match failures for data URLs on this path.
Collaborator
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Replaces the inline dynamic route matching loop after
afterFilesprocessing with a call to the existingcheckDynamicRouteshelper.Why?
The standalone dynamic route check (after
afterFilesroutes are exhausted) used an inline loop that matched againstcurrentUrl.pathnamedirectly. However, by the time execution reaches this point, the URL may still be in its normalized data URL form — it was re-normalized at line 700 forafterFilesprocessing and never denormalized back if noafterFilesroute matched.The
checkDynamicRouteshelper already handles this correctly: it conditionally denormalizes data URLs before matching (lines 307-310). This helper is already used for the equivalent dynamic route checks inside both theafterFilesloop (line 762) and thefallbackloop (line 929), making this the only dynamic route matching site that was missing the denormalization step.Without this fix, dynamic routes with
has/missingconditions could silently fail to match when reached via the standalone path with a data URL request.How?
Replaced the 51-line inline loop with a call to
checkDynamicRoutes, matching the exact pattern already established at theafterFilesandfallbackcall sites. The replacement is structurally identical — same arguments, same post-call handling (resetUrlpropagation,statusmerge).Test plan
resolve-routesunit tests passafterFileswithout matching now correctly denormalize before dynamic route matching