Skip to content

Commit c0eb353

Browse files
authored
fix: firefox video plays correctly (#616)
1 parent 957a950 commit c0eb353

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sw.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,9 @@ async function fetchHandler ({ path, request, event }: FetchHandlerArg): Promise
539539
async function errorPageResponse (fetchResponse: Response): Promise<Response> {
540540
const responseContentType = fetchResponse.headers.get('Content-Type')
541541
let json: Record<string, any> | null = null
542-
const responseBodyAsText: string | null = await fetchResponse.text()
542+
// Clone the response before consuming the body
543+
const responseCopy = fetchResponse.clone()
544+
const responseBodyAsText: string | null = await responseCopy.text()
543545

544546
if (responseContentType != null) {
545547
if (responseContentType.includes('text/html')) {

0 commit comments

Comments
 (0)