[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: -missing copyright header
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: -missing copyright header |
Date: |
Tue, 30 Jan 2024 15:06:18 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 673b56488 -missing copyright header
673b56488 is described below
commit 673b56488e3a07eb6bee6ab6972be46891889d4a
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Jan 30 15:06:14 2024 +0100
-missing copyright header
---
packages/taler-util/src/http-client/utils.ts | 41 ++++++++++++++++++++++------
1 file changed, 33 insertions(+), 8 deletions(-)
diff --git a/packages/taler-util/src/http-client/utils.ts
b/packages/taler-util/src/http-client/utils.ts
index e4b874c2f..7abedae63 100644
--- a/packages/taler-util/src/http-client/utils.ts
+++ b/packages/taler-util/src/http-client/utils.ts
@@ -1,3 +1,22 @@
+/*
+ This file is part of GNU Taler
+ (C) 2022-2024 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Imports.
+ */
import { base64FromArrayBuffer } from "../base64.js";
import { stringToBytes } from "../taler-crypto.js";
import { AccessToken, LongPollParams, PaginationParams } from "./types.js";
@@ -5,7 +24,10 @@ import { AccessToken, LongPollParams, PaginationParams } from
"./types.js";
/**
* Helper function to generate the "Authorization" HTTP header.
*/
-export function makeBasicAuthHeader(username: string, password: string):
string {
+export function makeBasicAuthHeader(
+ username: string,
+ password: string,
+): string {
const auth = `${username}:${password}`;
const authEncoded: string = base64FromArrayBuffer(stringToBytes(auth));
return `Basic ${authEncoded}`;
@@ -13,8 +35,8 @@ export function makeBasicAuthHeader(username: string,
password: string): string
/**
* rfc8959
- * @param token
- * @returns
+ * @param token
+ * @returns
*/
export function makeBearerTokenAuthHeader(token: AccessToken): string {
return `Bearer secret-token:${token}`;
@@ -26,17 +48,20 @@ export function makeBearerTokenAuthHeader(token:
AccessToken): string {
export function addPaginationParams(url: URL, pagination?: PaginationParams) {
if (!pagination) return;
if (pagination.offset) {
- url.searchParams.set("start", pagination.offset)
+ url.searchParams.set("start", pagination.offset);
}
- const order = !pagination || pagination.order === "asc" ? 1 : -1
- const limit = !pagination || !pagination.limit || pagination.limit === 0 ? 5
: Math.abs(pagination.limit)
+ const order = !pagination || pagination.order === "asc" ? 1 : -1;
+ const limit =
+ !pagination || !pagination.limit || pagination.limit === 0
+ ? 5
+ : Math.abs(pagination.limit);
//always send delta
- url.searchParams.set("delta", String(order * limit))
+ url.searchParams.set("delta", String(order * limit));
}
export function addLongPollingParam(url: URL, param?: LongPollParams) {
if (!param) return;
if (param.timeoutMs) {
- url.searchParams.set("long_poll_ms", String(param.timeoutMs))
+ url.searchParams.set("long_poll_ms", String(param.timeoutMs));
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: -missing copyright header,
gnunet <=