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 long URLs causing 400s with dynamic routes/rewrites #26221

Merged
merged 3 commits into from Jun 17, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jun 16, 2021

This fixes unexpectedly returning 400 for dynamic routes/rewrites for long URLs from checking for a matching page before applying the dynamic route/rewrite. This fixes the file-exists util to consider ENAMETOOLONG as the file not existing since it can't exist if the requested path is longer than the filesystem allows.

Bug

  • Related issues linked using fixes #number
  • Integration tests added

Fixes: #26204
Fixes: #25481
Fixes: #26090

@ijjk
Copy link
Member Author

ijjk commented Jun 16, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
buildDuration 13s 13s ⚠️ +59ms
buildDurationCached 3.2s 3.1s -125ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +91 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
/ failed reqs 0 0
/ total time (seconds) 2.348 2.628 ⚠️ +0.28
/ avg req/sec 1064.85 951.2 ⚠️ -113.65
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.36 1.34 -0.02
/error-in-render avg req/sec 1838.64 1865.36 +26.72
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 63 kB 63 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.17 kB 3.17 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 329 B 329 B
hooks-HASH.js gzip 903 B 903 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 322 B 322 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.41 kB 8.41 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
index.html gzip 522 B 522 B
link.html gzip 534 B 534 B
withRouter.html gzip 515 B 515 B
Overall change 1.57 kB 1.57 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
buildDuration 14.7s 14.8s ⚠️ +67ms
buildDurationCached 4.2s 4.3s ⚠️ +68ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +91 B
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 63 kB 63 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.17 kB 3.17 kB
amp-HASH.js gzip 527 B 527 B
css-HASH.js gzip 329 B 329 B
hooks-HASH.js gzip 903 B 903 B
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.65 kB 1.65 kB
routerDirect..HASH.js gzip 322 B 322 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 8.41 kB 8.41 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Serverless bundles
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_error.js 16.9 kB 16.9 kB
404.html 1.98 kB 1.98 kB
500.html 1.96 kB 1.96 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.17 kB 1.17 kB
css.html 1.35 kB 1.35 kB
hooks.html 1.23 kB 1.23 kB
index.js 17.2 kB 17.2 kB
link.js 17.5 kB 17.5 kB
routerDirect.js 17.3 kB 17.3 kB
withRouter.js 17.3 kB 17.3 kB
Overall change 105 kB 105 kB

Webpack 4 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
buildDuration 11.5s 11.5s ⚠️ +24ms
buildDurationCached 4.6s 4.5s -80ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +91 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
/ failed reqs 0 0
/ total time (seconds) 2.407 2.388 -0.02
/ avg req/sec 1038.76 1046.89 +8.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.302 1.346 ⚠️ +0.04
/error-in-render avg req/sec 1919.54 1857.14 ⚠️ -62.4
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 41.8 kB 41.8 kB
main-HASH.js gzip 7.99 kB 7.99 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 63.8 kB 63.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_app-HASH.js gzip 1.07 kB 1.07 kB
_error-HASH.js gzip 3.84 kB 3.84 kB
amp-HASH.js gzip 536 B 536 B
css-HASH.js gzip 333 B 333 B
hooks-HASH.js gzip 910 B 910 B
index-HASH.js gzip 227 B 227 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 295 B 295 B
withRouter-HASH.js gzip 292 B 292 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 9.28 kB 9.28 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
_buildManifest.js gzip 420 B 420 B
Overall change 420 B 420 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js fix/long-url-400 Change
index.html gzip 568 B 568 B
link.html gzip 579 B 579 B
withRouter.html gzip 559 B 559 B
Overall change 1.71 kB 1.71 kB
Commit: 7fb2291

@ijjk ijjk marked this pull request as ready for review June 16, 2021 20:05
@timneutkens timneutkens merged commit 598b1ef into vercel:canary Jun 17, 2021
@timneutkens timneutkens deleted the fix/long-url-400 branch June 17, 2021 08:59
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 24, 2021
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants