allow signature in requestr

This commit is contained in:
Sebastian 2023-07-20 17:02:17 -03:00
parent 2335c3418c
commit 535c04be5c
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069

View File

@ -48,6 +48,11 @@ export async function defaultRequestHandler<T>(
requestHeaders["Content-Type"] = requestHeaders["Content-Type"] =
options.contentType === "json" ? "application/json" : "text/plain"; options.contentType === "json" ? "application/json" : "text/plain";
if (options.talerAmlOfficerSignature) {
requestHeaders["Taler-AML-Officer-Signature"] =
options.talerAmlOfficerSignature;
}
const requestMethod = options?.method ?? "GET"; const requestMethod = options?.method ?? "GET";
const requestBody = options?.data; const requestBody = options?.data;
const requestTimeout = options?.timeout ?? 5 * 1000; const requestTimeout = options?.timeout ?? 5 * 1000;
@ -269,6 +274,7 @@ export interface RequestOptions {
params?: unknown; params?: unknown;
timeout?: number; timeout?: number;
contentType?: "text" | "json"; contentType?: "text" | "json";
talerAmlOfficerSignature?: string;
} }
async function buildRequestOk<T>( async function buildRequestOk<T>(