File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ async function pushForm(
44) : Promise < Response > {
55 const fields = new FormData ( form ) ;
66 const url = new URL ( form . action , location . origin ) ;
7- const headers = new Headers ( init . headers ) ;
8- if ( ! headers . has ( 'Accept' ) ) {
9- headers . append ( 'Accept' , 'text/html,application/xhtml+xml,application/xml' ) ;
7+ init . headers = new Headers ( init . headers ) ;
8+ if ( ! init . headers . has ( 'Accept' ) ) {
9+ init . headers . append ( 'Accept' , 'text/html,application/xhtml+xml,application/xml' ) ;
1010 }
1111
1212 init . method = form . method ;
@@ -18,7 +18,7 @@ async function pushForm(
1818 }
1919 } else {
2020 init . body = fields ;
21- headers . append ( 'Cache-Control' , 'max-age=0' ) ;
21+ init . headers . append ( 'Cache-Control' , 'max-age=0' ) ;
2222 }
2323
2424 return ( pushForm . fetch ?? fetch ) ( url . toString ( ) , init ) ;
You can’t perform that action at this time.
0 commit comments