Pārlūkot izejas kodu

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

dom111 6 gadi atpakaļ
vecāks
revīzija
526100c5ad
2 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 0 0
      src/webdav-min.js
  2. 6 0
      src/webdav.js

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 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);

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels