mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix activestorage direct upload on firefox
Direct upload on firefox is not working because it can’t handle click events on “input[type=submit]”. After a successful upload we can see on console a xml parse error, it happens because AWS S3 success body response is empty, so changing the reponseType suppress this error.
This commit is contained in:
parent
5af7d475c8
commit
c06b614c12
3 changed files with 3 additions and 1 deletions
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,7 @@ export class BlobUpload {
|
|||
|
||||
this.xhr = new XMLHttpRequest
|
||||
this.xhr.open("PUT", url, true)
|
||||
this.xhr.responseType = "text"
|
||||
for (const key in headers) {
|
||||
this.xhr.setRequestHeader(key, headers[key])
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ function submitForm(form) {
|
|||
if (button) {
|
||||
const { disabled } = button
|
||||
button.disabled = false
|
||||
button.focus()
|
||||
button.click()
|
||||
button.disabled = disabled
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue