Skip to content

Commit 876be2a

Browse files
peppescgclaude
andauthored
fix: exclude static assets from middleware matcher (#510)
* fix: exclude static assets from middleware matcher The proxy middleware intercepted requests to public static files (e.g. /bg-pattern.png on the signin page), causing a broken image icon. Extend the matcher regex to skip common image extensions. Backport of stacklok/stacklok-enterprise-platform#746. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add ip-address override to resolve GHSA-v2v4-37r5-5v8g Transitive dep ip-address@10.1.0 (via @modelcontextprotocol/sdk → express-rate-limit) has a medium severity vulnerability. Override to >=10.1.1 resolves the Grype and pnpm audit failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 83c8c70 commit 876be2a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/proxy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ export function proxy(request: NextRequest) {
1616

1717
export const config = {
1818
// Run on all routes except Next.js internals and static assets
19-
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
19+
matcher: [
20+
"/((?!_next/static|_next/image|favicon\\.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
21+
],
2022
};

0 commit comments

Comments
 (0)