user před 6 roky
rodič
revize
5096d9c9c9
3 změnil soubory, kde provedl 11 přidání a 19 odebrání
  1. 5 9
      lib/index.js
  2. 1 1
      lib/index.js.map
  3. 5 9
      src/index.ts

+ 5 - 9
lib/index.js

@@ -310,15 +310,11 @@ class BankClient {
                 addr: peerAddr,
                 topic: topic
             }));
-            const arg = encodeURIComponent(Buffer.from(JSON.stringify(retrieveRequest)).toString('base64'));
-            const ws = new ws_1.default(this.wsUrlBase + '/bank/ws?arg=' + arg, {
-                headers: {
-                    'x-msg': retrieveRequest.msg,
-                    'x-pub': retrieveRequest.pub,
-                    'x-pubhash': retrieveRequest.pubHash,
-                    'x-sig': retrieveRequest.sig
-                }
-            });
+            const jsonOutput = JSON.stringify(retrieveRequest);
+            const base64ed = Buffer.from(jsonOutput).toString('base64');
+            const encoded = encodeURIComponent(base64ed);
+            console.log('encoded', encoded);
+            const ws = new ws_1.default(this.wsUrlBase + '/bank/ws?arg=' + encoded);
             ws.on('open', () => {
                 connectCallback();
             });

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
lib/index.js.map


+ 5 - 9
src/index.ts

@@ -299,15 +299,11 @@ export class BankClient {
         topic: topic
       }));
 
-      const arg = encodeURIComponent(Buffer.from(JSON.stringify(retrieveRequest)).toString('base64'));
-      const ws = new WebSocket(this.wsUrlBase + '/bank/ws?arg=' + arg, {
-        headers: {
-          'x-msg': retrieveRequest.msg,
-          'x-pub': retrieveRequest.pub,
-          'x-pubhash': retrieveRequest.pubHash,
-          'x-sig': retrieveRequest.sig
-        }
-      });
+      const jsonOutput = JSON.stringify(retrieveRequest);
+      const base64ed = Buffer.from(jsonOutput).toString('base64');
+      const encoded = encodeURIComponent(base64ed);
+      console.log('encoded', encoded);
+      const ws = new WebSocket(this.wsUrlBase + '/bank/ws?arg=' + encoded);
       
       ws.on('open', () => {
         connectCallback();