diff options
author | razh <razh@users.noreply.github.com> | 2019-03-17 14:38:23 -0400 |
---|---|---|
committer | razh <razh@users.noreply.github.com> | 2019-03-17 14:50:39 -0400 |
commit | 2674fe38eb61b152e953a1a122040e119fd9f802 (patch) | |
tree | 05b1d95d829a22a0653c1fce8116767880fc1715 /actionview/app/assets | |
parent | 98e380f02452ee2597d122c76fd6b3a802f73333 (diff) | |
download | rails-2674fe38eb61b152e953a1a122040e119fd9f802.tar.gz rails-2674fe38eb61b152e953a1a122040e119fd9f802.tar.bz2 rails-2674fe38eb61b152e953a1a122040e119fd9f802.zip |
Revert "Pass HTML responses as plain-text in rails-ujs"
This reverts commit 48e44edfd0a8a7a29aa8fad39638ac0ee5243f42.
See discussion in #32287
For HTML content in `ajax:success` handlers, `event.detail[0]` should
be an `HTMLDocument` instance.
Diffstat (limited to 'actionview/app/assets')
-rw-r--r-- | actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee index 019bda635a..5b223d50f6 100644 --- a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee @@ -69,7 +69,7 @@ processResponse = (response, type) -> script.setAttribute('nonce', cspNonce()) script.text = response document.head.appendChild(script).parentNode.removeChild(script) - else if type.match(/\bxml\b/) + else if type.match(/\b(xml|html|svg)\b/) parser = new DOMParser() type = type.replace(/;.+/, '') # remove something like ';charset=utf-8' try response = parser.parseFromString(response, type) |