fix: keep daily brief independent from warning checks
This commit is contained in:
@@ -9,6 +9,7 @@ const ALLOWED_PATHS = new Set([
|
||||
"product",
|
||||
]);
|
||||
const IMGW_BASE_URL = "https://danepubliczne.imgw.pl/api/data";
|
||||
const USER_AGENT = "wtr./1.0 (weather data proxy)";
|
||||
|
||||
export async function GET(_: Request, context: { params: Promise<{ path: string[] }> }) {
|
||||
const { path } = await context.params;
|
||||
@@ -24,7 +25,7 @@ export async function GET(_: Request, context: { params: Promise<{ path: string[
|
||||
try {
|
||||
const response = await fetch(`${IMGW_BASE_URL}/${upstreamPath}`, {
|
||||
next: { revalidate: 300 },
|
||||
headers: { Accept: "application/json" },
|
||||
headers: { Accept: "application/json", "User-Agent": USER_AGENT },
|
||||
});
|
||||
if (!response.ok) {
|
||||
return NextResponse.json({ error: "IMGW API jest chwilowo niedostępne." }, { status: response.status });
|
||||
|
||||
Reference in New Issue
Block a user