gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: prevent cors and cache option


From: gnunet
Subject: [taler-wallet-core] branch master updated: prevent cors and cache options
Date: Wed, 15 Mar 2023 13:55:08 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new f414ca39e prevent cors and cache options
f414ca39e is described below

commit f414ca39e446563eb10c3c20defe79952fe71e6a
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Mar 15 09:55:01 2023 -0300

    prevent cors and cache options
---
 packages/web-util/src/utils/request.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/packages/web-util/src/utils/request.ts 
b/packages/web-util/src/utils/request.ts
index c7bca2de9..d05a4ec84 100644
--- a/packages/web-util/src/utils/request.ts
+++ b/packages/web-util/src/utils/request.ts
@@ -51,6 +51,8 @@ export async function defaultRequestHandler<T>(
   const requestBody = options?.data;
   const requestTimeout = options?.timeout ?? 5 * 1000;
   const requestParams = options.params ?? {};
+  const requestPreventCache = options.preventCache ?? false;
+  const requestPreventCors = options.preventCors ?? false;
 
   const _url = new URL(`${baseUrl}${endpoint}`);
 
@@ -84,7 +86,8 @@ export async function defaultRequestHandler<T>(
       headers: requestHeaders,
       method: requestMethod,
       credentials: "omit",
-      mode: "cors",
+      mode: requestPreventCors ? "no-cors" : "cors",
+      cache: requestPreventCache ? "no-cache" : "default",
       body: payload,
       signal: controller.signal,
     });
@@ -301,6 +304,8 @@ export interface RequestOptions {
     username: string;
     password: string;
   };
+  preventCache?: boolean;
+  preventCors?: boolean;
   data?: any;
   params?: unknown;
   timeout?: number;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]