fix: keep daily brief independent from warning checks

This commit is contained in:
zv
2026-06-12 21:43:34 +02:00
parent 763de7fd05
commit 1ff76cf847
3 changed files with 24 additions and 7 deletions

View File

@@ -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 });