1
0
Fork 0
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:
_N_I_X_O_N_ 2017-09-12 14:35:33 -03:00 committed by lazaronixon
parent 5af7d475c8
commit c06b614c12
3 changed files with 3 additions and 1 deletions

File diff suppressed because one or more lines are too long

View file

@ -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])
}

View file

@ -53,6 +53,7 @@ function submitForm(form) {
if (button) {
const { disabled } = button
button.disabled = false
button.focus()
button.click()
button.disabled = disabled
} else {