diff options
Diffstat (limited to 'packages/taler-util/src/http-impl.qtart.ts')
-rw-r--r-- | packages/taler-util/src/http-impl.qtart.ts | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts index fb642ac89..d4ec26bd0 100644 --- a/packages/taler-util/src/http-impl.qtart.ts +++ b/packages/taler-util/src/http-impl.qtart.ts @@ -97,10 +97,24 @@ export class HttpLibImpl implements HttpRequestLibrary { data, headers: headersList, }); + + const headers: Headers = new Headers(); + + if (res.headers) { + for (const headerStr of res.headers) { + const splitPos = headerStr.indexOf(":"); + if (splitPos < 0) { + continue; + } + const headerName = headerStr.slice(0, splitPos).trim().toLowerCase(); + const headerValue = headerStr.slice(splitPos + 1).trim(); + headers.set(headerName, headerValue); + } + } + return { requestMethod: method, - // FIXME: We don't return headers! - headers: new Headers(), + headers, async bytes() { return res.data; }, |