-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(web): serve public static assets on self-hosted deployments #2127
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -132,6 +132,6 @@ export async function proxy(request: NextRequest) { | |||||
|
|
||||||
| export const config = { | ||||||
| matcher: [ | ||||||
| "/((?!api|_next/static|_next/image|favicon.ico|robots.txt|sitemap.xml).*)", | ||||||
| "/((?!api|_next/static|_next/image|favicon.ico|robots.txt|sitemap.xml|.*\\.(?:avif|css|gif|ico|jpe?g|js|map|mp3|mp4|png|svg|webmanifest|webp|woff2?)).*)", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a self-hosted page requests existing
Suggested change
Knowledge Base Used: Web App (apps/web) Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/web/proxy.ts
Line: 135
Comment:
**Existing asset formats remain redirected**
When a self-hosted page requests existing `.riv`, `.ogg`, `.wasm`, or `.otf` public assets, the matcher still sends those requests through the proxy, causing Rive animations, recorder sounds, and related resources to redirect to `/login` instead of loading.
```suggestion
"/((?!api|_next/static|_next/image|favicon.ico|robots.txt|sitemap.xml|.*\\.(?:avif|css|gif|ico|jpe?g|js|map|mp3|mp4|ogg|otf|png|riv|svg|wasm|webmanifest|webp|woff2?)).*)",
```
**Knowledge Base Used:** [Web App (apps/web)](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/web-app.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||||||
| ], | ||||||
| }; | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assertions only search the entire source file for
svgandwoff2?, so they remain green when those strings exist outside a functioning matcher and do not protect the self-hosted asset-routing behavior the test names.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!