Browse Source

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

dom111 6 năm trước cách đây
mục cha
commit
526100c5ad
2 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 0 0
      src/webdav-min.js
  2. 6 0
      src/webdav.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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);

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác