15 lines
528 B
TypeScript
15 lines
528 B
TypeScript
import type { NextRequest } from "next/server";
|
|
import { currentSourceUrl } from "@/entities/datalibrary/api/preview-routes";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
// Older clients used this URL for both JSON lookups and inline page images.
|
|
function redirectToDc(request: NextRequest): Response {
|
|
return new Response(null, {
|
|
status: 307,
|
|
headers: { Location: currentSourceUrl("general-search") + request.nextUrl.search, "Cache-Control": "no-store" },
|
|
});
|
|
}
|
|
|
|
export { redirectToDc as GET, redirectToDc as POST };
|