New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

edge-core-js

Package Overview
Dependencies
Maintainers
6
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edge-core-js - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

4

CHANGELOG.md
# edge-core-js
## v1.3.3 (2023-07-24)
- changed: Add fallback to bridged `fetch` if request to edge-cors-proxy server fails
## v1.3.2 (2023-07-13)

@@ -4,0 +8,0 @@

@@ -1,2 +0,2 @@

function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }import './polyfills'
import './polyfills'

@@ -6,2 +6,3 @@ import hashjs from 'hash.js'

import { base64 } from 'rfc4648'
import { makeFetchResponse } from 'serverlet'
import { Bridge, bridgifyObject } from 'yaob'

@@ -26,2 +27,4 @@

const hostnameProxyWhitelist = new Map()
// A map of domains that failed CORS and failed via the CORS proxy server and succeeded via native fetch
const hostnameBridgeProxyWhitelist = new Map()

@@ -92,2 +95,10 @@ // Set up the bridges:

const bridgeFetch = async (
uri,
opts
) => {
const response = await clientIo.fetchCors(uri, opts)
return makeFetchResponse(response)
}
const io = {

@@ -141,9 +152,13 @@ disklet: {

uri,
opts
opts = {}
) {
const { hostname } = new URL(uri)
// Proactively use bridgeFetch for any hostnames added to whitelist:
if (hostnameBridgeProxyWhitelist.get(hostname) === true) {
return await bridgeFetch(uri, opts)
}
// Proactively use fetchCorsProxy for any hostnames added to whitelist:
if (hostnameProxyWhitelist.get(hostname) === true) {
return await fetchCorsProxy(uri, _nullishCoalesce(opts, () => ( {})))
return await fetchCorsProxy(uri, opts)
}

@@ -162,2 +177,8 @@

} catch (_) {
// Fallback to bridge fetch if everything else fails
try {
const response = await bridgeFetch(uri, opts)
hostnameBridgeProxyWhitelist.set(hostname, true)
return response
} catch (_) {}
// Throw the error from the first fetch instead of the one from

@@ -231,3 +252,3 @@ // proxy server.

uri,
opts = {}
opts
) => {

@@ -234,0 +255,0 @@ const shuffledUrls = shuffle([...PROXY_SERVER_URLS])

2

package.json
{
"name": "edge-core-js",
"version": "1.3.2",
"version": "1.3.3",
"description": "Edge account & wallet management library",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

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