Skip to content

Commit c547c78

Browse files
committed
Get form URL more reliably /2
1 parent 1debdb3 commit c547c78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default async function pushForm(
99
init: RequestInit = {},
1010
): Promise<Response> {
1111
const fields = new FormData(form);
12-
const url = new URL(form.getAttribute('action')!, location.origin);
12+
const url = new URL(form.getAttribute('action') ?? '', location.origin);
1313
init.headers = new Headers(init.headers);
1414
if (!init.headers.has('Accept')) {
1515
init.headers.append(

0 commit comments

Comments
 (0)