Skip to content

Commit

Permalink
Get form URL more reliably /2
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 29, 2022
1 parent 1debdb3 commit c547c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function pushForm(
init: RequestInit = {},
): Promise<Response> {
const fields = new FormData(form);
const url = new URL(form.getAttribute('action')!, location.origin);
const url = new URL(form.getAttribute('action') ?? '', location.origin);
init.headers = new Headers(init.headers);
if (!init.headers.has('Accept')) {
init.headers.append(
Expand Down

0 comments on commit c547c78

Please # to comment.