chore: fix middleware bypass for media and bump to rc.13
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 1m14s
Build & Deploy / 🏗️ Build (push) Successful in 2m48s
Build & Deploy / 🚀 Deploy (push) Successful in 15s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 49s
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 1m14s
Build & Deploy / 🏗️ Build (push) Successful in 2m48s
Build & Deploy / 🚀 Deploy (push) Successful in 15s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 49s
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -26,6 +26,8 @@ export default async function middleware(request: NextRequest) {
|
|||||||
pathname.startsWith('/errors') ||
|
pathname.startsWith('/errors') ||
|
||||||
pathname.startsWith('/health') ||
|
pathname.startsWith('/health') ||
|
||||||
pathname.startsWith('/uploads') ||
|
pathname.startsWith('/uploads') ||
|
||||||
|
pathname.startsWith('/media') ||
|
||||||
|
pathname.startsWith('/_next/image') ||
|
||||||
pathname.includes('/api/og') ||
|
pathname.includes('/api/og') ||
|
||||||
pathname.includes('opengraph-image') ||
|
pathname.includes('opengraph-image') ||
|
||||||
pathname.endsWith('sitemap.xml') ||
|
pathname.endsWith('sitemap.xml') ||
|
||||||
@@ -61,7 +63,7 @@ export default async function middleware(request: NextRequest) {
|
|||||||
if (['GET', 'HEAD'].includes(request.method)) {
|
if (['GET', 'HEAD'].includes(request.method)) {
|
||||||
// Clone headers to ensure all Next.js internal headers (like router state) are preserved
|
// Clone headers to ensure all Next.js internal headers (like router state) are preserved
|
||||||
const clonedHeaders = new Headers(request.headers);
|
const clonedHeaders = new Headers(request.headers);
|
||||||
|
|
||||||
effectiveRequest = new NextRequest(urlObj, {
|
effectiveRequest = new NextRequest(urlObj, {
|
||||||
headers: clonedHeaders,
|
headers: clonedHeaders,
|
||||||
method: request.method,
|
method: request.method,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "2.3.22-rc.12",
|
"version": "2.3.22-rc.13",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@parcel/watcher",
|
"@parcel/watcher",
|
||||||
|
|||||||
Reference in New Issue
Block a user