Fixed the new build failure in [src/proxy.ts]
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -44,7 +44,7 @@ const EXTENSION_MIME_TYPES: Record<string, string> = {
|
|||||||
export const MEDIA_MAX_UPLOAD_BYTES = Number(process.env.MEDIA_MAX_UPLOAD_BYTES ?? 5_000_000);
|
export const MEDIA_MAX_UPLOAD_BYTES = Number(process.env.MEDIA_MAX_UPLOAD_BYTES ?? 5_000_000);
|
||||||
|
|
||||||
/** Overridable so a non-Docker deployment can point this somewhere else; defaults to a directory next to the app, outside public/. */
|
/** Overridable so a non-Docker deployment can point this somewhere else; defaults to a directory next to the app, outside public/. */
|
||||||
const MEDIA_ROOT = path.resolve(process.env.MEDIA_STORAGE_ROOT || path.join(/* turbopackIgnore: true */ process.cwd(), "storage", "media"));
|
const MEDIA_ROOT = path.resolve(process.env.MEDIA_STORAGE_ROOT || path.join(/*turbopackIgnore: true*/ process.cwd(), "storage", "media"));
|
||||||
|
|
||||||
export const MEDIA_URL_PREFIX = "/api/media/";
|
export const MEDIA_URL_PREFIX = "/api/media/";
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -82,7 +82,9 @@ function buildCsp(): string {
|
|||||||
].join("; ");
|
].join("; ");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handleProxyRequest(req: NextRequest) {
|
type AuthenticatedNextRequest = NextRequest & { auth?: unknown };
|
||||||
|
|
||||||
|
export async function handleProxyRequest(req: AuthenticatedNextRequest) {
|
||||||
const { pathname } = req.nextUrl;
|
const { pathname } = req.nextUrl;
|
||||||
const csp = buildCsp();
|
const csp = buildCsp();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user