Skip to content

Commit 53ae689

Browse files
committed
fix: strip query params from brand asset paths
1 parent de0bd0d commit 53ae689

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cli/server-app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ Respond in character as this person. Be direct, personal, emotional. Reference y
524524
}
525525

526526
// Serve brand assets
527-
if (req.url?.startsWith('/brand/')) {
528-
const brandPath = resolve(__dirname, '..', '..', 'assets', req.url.replace('/brand/', ''));
527+
if (req.url?.split('?')[0].startsWith('/brand/')) {
528+
const brandPath = resolve(__dirname, '..', '..', 'assets', req.url.split('?')[0].replace('/brand/', ''));
529529
if (existsSync(brandPath)) {
530530
const ext = brandPath.split('.').pop() || '';
531531
const types: Record<string,string> = { svg:'image/svg+xml', png:'image/png', jpg:'image/jpeg', css:'text/css', js:'application/javascript', woff2:'font/woff2' };

0 commit comments

Comments
 (0)