Skip to content

Commit

Permalink
fix: avoid Host header getting merged
Browse files Browse the repository at this point in the history
Fixes #400
  • Loading branch information
harlan-zw committed Jan 22, 2025
1 parent d78a13c commit 2420ea5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/server/sitemap/urlset/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function fetchDataSource(input: SitemapSourceBase | SitemapSourceRe
signal: timeoutController.signal,
headers: defu(options?.headers, {
Accept: isXmlRequest ? 'text/xml' : 'application/json',
}, event ? { Host: getRequestHost(event, { xForwardedHost: true }) } : {}),
}, event ? { host: getRequestHost(event, { xForwardedHost: true }) } : {}),
// @ts-expect-error untyped
onResponse({ response }) {
if (typeof response._data === 'string' && response._data.startsWith('<!DOCTYPE html>'))
Expand Down

0 comments on commit 2420ea5

Please sign in to comment.