Skip to content

Commit

Permalink
Handle readyState in submitRequest function
Browse files Browse the repository at this point in the history
  • Loading branch information
enyo committed Apr 2, 2021
1 parent 4e73fad commit 4048e4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 5.9.2

- Handle `xhr.readyState` in the `submitRequest` function and don't attempt to
send if it's not `1` (OPENED). (thanks to @bobbysmith007)

## 5.9.1

- Fix the way upload progress is calculated when using chunked uploads. (thanks
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "dropzone",
"version": "5.9.1",
"version": "5.9.2",
"description": "Handles drag and drop of files for you.",
"keywords": [
"dragndrop",
Expand Down
6 changes: 6 additions & 0 deletions src/dropzone.js
Expand Up @@ -1648,6 +1648,12 @@ export default class Dropzone extends Emitter {
}

submitRequest(xhr, formData, files) {
if (xhr.readyState != 1) {
console.warn(
"Cannot send this request because the XMLHttpRequest.readyState is not OPENED."
);
return;
}
xhr.send(formData);
}

Expand Down

0 comments on commit 4048e4c

Please sign in to comment.