gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: taler-util: follow http redir


From: gnunet
Subject: [taler-wallet-core] branch master updated: taler-util: follow http redirects on NodeJS
Date: Mon, 05 Feb 2024 23:57:13 +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 78ba50dad taler-util: follow http redirects on NodeJS
78ba50dad is described below

commit 78ba50dadceb594180db9f0b61786f264dd0044b
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Feb 5 23:57:09 2024 +0100

    taler-util: follow http redirects on NodeJS
---
 packages/taler-util/package.json          |  2 ++
 packages/taler-util/src/http-impl.node.ts |  8 ++++----
 pnpm-lock.yaml                            | 24 +++++++++++++++++++++++-
 3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/packages/taler-util/package.json b/packages/taler-util/package.json
index c8ddd5a7f..472310fe5 100644
--- a/packages/taler-util/package.json
+++ b/packages/taler-util/package.json
@@ -64,6 +64,7 @@
     "pretty": "prettier --write src"
   },
   "devDependencies": {
+    "@types/follow-redirects": "^1.14.4",
     "@types/node": "^18.11.17",
     "ava": "^6.0.1",
     "esbuild": "^0.19.9",
@@ -73,6 +74,7 @@
   "dependencies": {
     "big-integer": "^1.6.52",
     "fflate": "^0.8.1",
+    "follow-redirects": "^1.15.5",
     "hash-wasm": "^4.11.0",
     "jed": "^1.1.1",
     "tslib": "^2.6.2"
diff --git a/packages/taler-util/src/http-impl.node.ts 
b/packages/taler-util/src/http-impl.node.ts
index fe2da891c..b9c007b35 100644
--- a/packages/taler-util/src/http-impl.node.ts
+++ b/packages/taler-util/src/http-impl.node.ts
@@ -19,9 +19,9 @@
 /**
  * Imports.
  */
-import * as http from "node:http";
-import * as https from "node:https";
 import * as net from "node:net";
+import type { ClientRequest, IncomingMessage } from "node:http";
+import { RedirectableRequest, http, https } from "follow-redirects";
 import { RequestOptions } from "node:http";
 import { TalerError } from "./errors.js";
 import { encodeBody, getDefaultHeaders, HttpLibArgs } from "./http-common.js";
@@ -177,7 +177,7 @@ export class HttpLibImpl implements HttpRequestLibrary {
     }
 
     return new Promise((resolve, reject) => {
-      const handler = (res: http.IncomingMessage) => {
+      const handler = (res: IncomingMessage) => {
         res.on("data", (d) => {
           chunks.push(d);
         });
@@ -227,7 +227,7 @@ export class HttpLibImpl implements HttpRequestLibrary {
         });
       };
 
-      let req: http.ClientRequest;
+      let req: RedirectableRequest<ClientRequest, IncomingMessage>;
       if (options.protocol === "http:") {
         req = http.request(options, handler);
       } else if (options.protocol === "https:") {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c673d6d6c..ad7cfa840 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,4 +1,4 @@
-lockfileVersion: '6.1'
+lockfileVersion: '6.0'
 
 settings:
   autoInstallPeers: true
@@ -743,6 +743,9 @@ importers:
       fflate:
         specifier: ^0.8.1
         version: 0.8.1
+      follow-redirects:
+        specifier: ^1.15.5
+        version: 1.15.5
       hash-wasm:
         specifier: ^4.11.0
         version: 4.11.0
@@ -753,6 +756,9 @@ importers:
         specifier: ^2.6.2
         version: 2.6.2
     devDependencies:
+      '@types/follow-redirects':
+        specifier: ^1.14.4
+        version: 1.14.4
       '@types/node':
         specifier: ^18.11.17
         version: 18.11.17
@@ -5961,6 +5967,12 @@ packages:
   /@types/filewriter@0.0.29:
     resolution: {integrity: 
sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==}
 
+  /@types/follow-redirects@1.14.4:
+    resolution: {integrity: 
sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==}
+    dependencies:
+      '@types/node': 20.11.13
+    dev: true
+
   /@types/har-format@1.2.9:
     resolution: {integrity: 
sha512-rffW6MhQ9yoa75bdNi+rjZBAvu2HhehWJXlhuWXnWdENeuKe82wUgAwxYOb7KRKKmxYN+D/iRKd2NDQMLqlUmg==}
 
@@ -10864,6 +10876,16 @@ packages:
         optional: true
     dev: true
 
+  /follow-redirects@1.15.5:
+    resolution: {integrity: 
sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==}
+    engines: {node: '>=4.0'}
+    peerDependencies:
+      debug: '*'
+    peerDependenciesMeta:
+      debug:
+        optional: true
+    dev: false
+
   /for-each@0.3.3:
     resolution: {integrity: 
sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
     dependencies:

-- 
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]