fix(js): tolerate missing File constructor
Guard URL-encoded form serialization so constrained browser contexts without File still submit generated hemx forms instead of throwing before fetch. req: runtime/002
This commit is contained in:
@@ -153,7 +153,7 @@
|
||||
function urlEncoded(data) {
|
||||
const encoded = new URLSearchParams();
|
||||
for (const [name, value] of data.entries()) {
|
||||
if (value instanceof File) continue;
|
||||
if (typeof File !== "undefined" && value instanceof File) continue;
|
||||
encoded.append(name, value);
|
||||
}
|
||||
return encoded;
|
||||
|
||||
Reference in New Issue
Block a user