Skip to content

Commit b9d062e

Browse files
authored
fix: error page merges verified-fetch headers (#531)
1 parent 6181967 commit b9d062e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sw.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ async function errorPageResponse (fetchResponse: Response): Promise<Response> {
562562
/**
563563
* TODO: output configuration
564564
*/
565+
const mergedHeaders = new Headers(fetchResponse.headers)
566+
mergedHeaders.set('Content-Type', 'text/html')
567+
565568
return new Response(`<!DOCTYPE html>
566569
<html>
567570
<head>
@@ -595,9 +598,7 @@ async function errorPageResponse (fetchResponse: Response): Promise<Response> {
595598
</html>`, {
596599
status: fetchResponse.status,
597600
statusText: fetchResponse.statusText,
598-
headers: new Headers({
599-
'Content-Type': 'text/html'
600-
})
601+
headers: mergedHeaders
601602
})
602603
}
603604

0 commit comments

Comments
 (0)