Ver Fonte

Removed: switch for cors

James Doyle há 3 anos atrás
pai
commit
c339c96d81

+ 0 - 5
config/scribe.php

@@ -186,11 +186,6 @@ return [
          */
         'base_url' => null,
 
-        /**
-         * Set the referrer, mode, and credentials, values in the fetch calls
-         */
-        'use_cors' => true,
-
         /**
          * Fetch the CSRF token before each request. This is required if you are using Laravel Sanctum
          */

+ 3 - 5
resources/js/tryitout.js

@@ -98,11 +98,9 @@ function makeAPICall(method, path, body, query, headers, endpointId) {
         headers,
         body: method === 'GET' ? undefined : body,
         signal: window.abortControllers[endpointId].signal,
-        ...window.useCors ? {
-            referrer: window.baseUrl,
-            mode: 'cors',
-            credentials: 'same-origin',
-        } : {},
+        referrer: window.baseUrl,
+        mode: 'cors',
+        credentials: 'same-origin',
     })
         .then(response => Promise.all([response.status, response.text(), response.headers]));
 }

+ 0 - 1
resources/views/themes/default/index.blade.php

@@ -24,7 +24,6 @@
     <script src="//cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
     <script>
         var baseUrl = "{{ $tryItOut['base_url'] ?? config('app.url') }}";
-        var useCors = Boolean({{ $tryItOut['use_cors'] ?? null }});
         var useCsrf = Boolean({{ $tryItOut['use_csrf'] ?? null }});
         var csrfUrl = "{{ $tryItOut['csrf_url'] ?? null }}";
         var csrfCookieName = "{{ $tryItOut['csrf_cookie_name'] ?? "XSRF-TOKEN" }}";