Browse Source

Fix `.js` files being executed when being requested via `jQuery.ajax`

dom111 6 years ago
parent
commit
526100c5ad
2 changed files with 6 additions and 0 deletions
  1. 0 0
      src/webdav-min.js
  2. 6 0
      src/webdav.js

File diff suppressed because it is too large
+ 0 - 0
src/webdav-min.js


+ 6 - 0
src/webdav.js

@@ -76,6 +76,12 @@
                     var deferred = $.Deferred(),
                     $container = $('<pre class="prettyprint"></pre>');
                     $.ajax(url, {
+                      // @url https://decadecity.net/blog/2013/06/21/preventing-script-execution-with-jquerys-ajax-function
+                      converters: {
+                        'text script': function (text) {
+                          return text;
+                        }
+                      },
                       complete: function(response, status) {
                         if (status !== "error") {
                           $container.text(response.responseText);

Some files were not shown because too many files changed in this diff