fix: prettier formatting and downgrade upload-artifact to v3 for Gitea
This commit is contained in:
9 files changed
+32
-23
No files matched your search
+2
-9
@@ -22,10 +22,7 @@ export function isAllowedOrigin(request: Request): boolean {
|
||||
}
|
||||
|
||||
function resolveAllowedOrigin(origin: string | null): string {
|
||||
if (
|
||||
origin !== null &&
|
||||
(origin === ALLOWED_ORIGIN || (isDev() && DEV_ORIGINS.has(origin)))
|
||||
) {
|
||||
if (origin !== null && (origin === ALLOWED_ORIGIN || (isDev() && DEV_ORIGINS.has(origin)))) {
|
||||
return origin;
|
||||
}
|
||||
return ALLOWED_ORIGIN;
|
||||
@@ -79,11 +76,7 @@ export function jsonErrorWithCors(
|
||||
},
|
||||
});
|
||||
}
|
||||
export function jsonWithCors(
|
||||
data: unknown,
|
||||
sMaxage = 3600,
|
||||
origin?: string | null,
|
||||
): NextResponse {
|
||||
export function jsonWithCors(data: unknown, sMaxage = 3600, origin?: string | null): NextResponse {
|
||||
return NextResponse.json(data, {
|
||||
headers: {
|
||||
"Cache-Control": `public, s-maxage=${sMaxage}, stale-while-revalidate=86400`,
|
||||
|
||||
Reference in new issue
Block a user