Browse Source

[HTML5] Fetch API now passes credentials.

Used default value before, i.e. "same-origin", now uses "include" (i.e.
include for cross-origin if cross-origin is allowed).

(cherry picked from commit ffe248cbdfc70a0887970248209c586869c0855e)
Fabio Alessandrelli 3 years ago
parent
commit
06de19a266
1 changed files with 1 additions and 0 deletions
  1. 1 0
      platform/javascript/js/libs/library_godot_fetch.js

+ 1 - 0
platform/javascript/js/libs/library_godot_fetch.js

@@ -89,6 +89,7 @@ const GodotFetch = {
 				method: method,
 				headers: headers,
 				body: body,
+				credentials: 'include',
 			};
 			obj.request = fetch(url, init);
 			obj.request.then(GodotFetch.onresponse.bind(null, id)).catch(GodotFetch.onerror.bind(null, id));