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

@tomphttp/bare-client

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tomphttp/bare-client - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2-beta

31

dist/BareClient.js

@@ -744,2 +744,17 @@ // The user likely has overwritten all networking functions after importing bare-client

}
function resolvePort(url) {
if (url.port)
return Number(url.port);
switch (url.protocol) {
case 'ws:':
case 'http:':
return 80;
case 'wss:':
case 'https:':
return 443;
default:
// maybe blob
return 0;
}
}
class BareClient {

@@ -827,3 +842,3 @@ /**

requestHeaders['Sec-Websocket-Protocol'] = protocols.join(', ');
return this.connect(requestHeaders, url.protocol, url.hostname, url.port, url.pathname + url.search);
return this.connect(requestHeaders, url.protocol, url.hostname, resolvePort(url), url.pathname + url.search);
}

@@ -879,16 +894,4 @@ async fetch(url, init = {}) {

for (let i = 0;; i++) {
let port;
if (url.port === '') {
if (url.protocol === 'https:') {
port = '443';
}
else {
port = '80';
}
}
else {
port = url.port;
}
headers.host = url.host;
const response = await this.request(method, headers, body, url.protocol, url.hostname, port, url.pathname + url.search, cache, signal);
const response = await this.request(method, headers, body, url.protocol, url.hostname, resolvePort(url), url.pathname + url.search, cache, signal);
response.finalURL = url.toString();

@@ -895,0 +898,0 @@ if (statusRedirect.includes(response.status)) {

{
"name": "@tomphttp/bare-client",
"version": "1.1.1",
"version": "1.1.2-beta",
"homepage": "https://github.com/tomphttp",

@@ -5,0 +5,0 @@ "bugs": {

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