Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onflow/transport-http

Package Overview
Dependencies
Maintainers
14
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/transport-http - npm Package Compare versions

Comparing version 1.10.0 to 1.10.1

types/combine-urls.d.ts

9

CHANGELOG.md
# @onflow/transport-http
## 1.10.1
### Patch Changes
- [#1882](https://github.com/onflow/fcl-js/pull/1882) [`dfc5472e`](https://github.com/onflow/fcl-js/commit/dfc5472e94c8237b048940ebc44742071f77f59d) Thanks [@jribbink](https://github.com/jribbink)! - Fix accessNode.api URL concatenation with paths in baseURL
- Updated dependencies [[`6c635f9f`](https://github.com/onflow/fcl-js/commit/6c635f9ff340284845ffe1196965ced7c748294f)]:
- @onflow/util-invariant@1.2.3
## 1.10.0

@@ -4,0 +13,0 @@

44

dist/sdk-send-http.js

@@ -45,2 +45,42 @@ 'use strict';

/**
* This file was taken from the Axios project and modified to work with TypeScript/ES6 modules.
*
* The original file can be found on GitHub:
* https://github.com/axios/axios/blob/fe7d09bb08fa1c0e414956b7fc760c80459b0a43/lib/helpers/combineURLs.js
*
* The original license is included below:
*
* Copyright (c) 2014 Matt Zabriskie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Creates a new URL by combining the specified URLs
*
* @param baseURL The base URL
* @param relativeURL The relative URL
* @returns The combined URL
*/
function combineURLs(baseURL, relativeURL) {
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
const AbortController = globalThis.AbortController || require("abort-controller");

@@ -111,3 +151,3 @@ class HTTPRequestError extends Error {

}, timeoutLimit);
return fetchTransport__default["default"](new URL(path, hostname).toString(), {
return fetchTransport__default["default"](combineURLs(hostname, path).toString(), {
method: method,

@@ -625,3 +665,3 @@ body: bodyJSON,

});
let ret = typeof context?.response === 'function' ? context.response() : {};
let ret = typeof context?.response === "function" ? context.response() : {};
ret.tag = ix.tag;

@@ -628,0 +668,0 @@ return ret;

@@ -17,2 +17,42 @@ import { invariant } from '@onflow/util-invariant';

/**
* This file was taken from the Axios project and modified to work with TypeScript/ES6 modules.
*
* The original file can be found on GitHub:
* https://github.com/axios/axios/blob/fe7d09bb08fa1c0e414956b7fc760c80459b0a43/lib/helpers/combineURLs.js
*
* The original license is included below:
*
* Copyright (c) 2014 Matt Zabriskie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Creates a new URL by combining the specified URLs
*
* @param baseURL The base URL
* @param relativeURL The relative URL
* @returns The combined URL
*/
function combineURLs(baseURL, relativeURL) {
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
const AbortController = globalThis.AbortController || require("abort-controller");

@@ -83,3 +123,3 @@ class HTTPRequestError extends Error {

}, timeoutLimit);
return fetchTransport(new URL(path, hostname).toString(), {
return fetchTransport(combineURLs(hostname, path).toString(), {
method: method,

@@ -597,3 +637,3 @@ body: bodyJSON,

});
let ret = typeof context?.response === 'function' ? context.response() : {};
let ret = typeof context?.response === "function" ? context.response() : {};
ret.tag = ix.tag;

@@ -600,0 +640,0 @@ return ret;

@@ -39,2 +39,42 @@ (function (global, factory) {

/**
* This file was taken from the Axios project and modified to work with TypeScript/ES6 modules.
*
* The original file can be found on GitHub:
* https://github.com/axios/axios/blob/fe7d09bb08fa1c0e414956b7fc760c80459b0a43/lib/helpers/combineURLs.js
*
* The original license is included below:
*
* Copyright (c) 2014 Matt Zabriskie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Creates a new URL by combining the specified URLs
*
* @param baseURL The base URL
* @param relativeURL The relative URL
* @returns The combined URL
*/
function combineURLs(baseURL, relativeURL) {
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
const AbortController = globalThis.AbortController || require("abort-controller");

@@ -105,3 +145,3 @@ class HTTPRequestError extends Error {

}, timeoutLimit);
return fetchTransport__default["default"](new URL(path, hostname).toString(), {
return fetchTransport__default["default"](combineURLs(hostname, path).toString(), {
method: method,

@@ -619,3 +659,3 @@ body: bodyJSON,

});
let ret = typeof context?.response === 'function' ? context.response() : {};
let ret = typeof context?.response === "function" ? context.response() : {};
ret.tag = ix.tag;

@@ -622,0 +662,0 @@ return ret;

8

package.json
{
"name": "@onflow/transport-http",
"version": "1.10.0",
"version": "1.10.1",
"description": "Flow SDK HTTP Transport Module",

@@ -18,4 +18,4 @@ "license": "Apache-2.0",

"@onflow/rlp": "1.2.2",
"@onflow/sdk": "1.4.0",
"@onflow/types": "1.3.0",
"@onflow/sdk": "1.5.0",
"@onflow/types": "1.4.0",
"jest": "^29.5.0"

@@ -39,3 +39,3 @@ },

"@onflow/util-address": "1.2.2",
"@onflow/util-invariant": "1.2.2",
"@onflow/util-invariant": "1.2.3",
"@onflow/util-logger": "1.3.2",

@@ -42,0 +42,0 @@ "@onflow/util-template": "1.2.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc