This commit is contained in:
kakkokari-gtyih 2024-12-28 18:09:18 +09:00
parent e99ae2a9f3
commit 5ad0fe70a1
1 changed files with 5 additions and 2 deletions

View File

@ -17,9 +17,12 @@ const httpUrl = `http://localhost:${port}/`;
const websocketUrl = `ws://localhost:${port}/`;
const embedUrl = `http://localhost:5174/`;
// activitypubリクエストはProxyを通し、それ以外はViteの開発サーバーを返す
// activitypubリクエスト・streaming用のートはProxyを通し、それ以外はViteの開発サーバーを返す
function varyHandler(req: IncomingMessage) {
if (req.headers.accept?.includes('application/activity+json')) {
if (
req.headers.accept?.includes('application/activity+json') ||
/notes\/[A-Za-z0-9-]+\.json$/.test(req.url ?? '')
) {
return null;
}
return '/index.html';