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

balena-request

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balena-request - npm Package Compare versions

Comparing version 11.1.0 to 11.1.1-no-refresh-on-absolute-url-a61c8bb2a7c144748048e41b201f1ee2f7d6e7c7

14

build/request.js

@@ -56,3 +56,4 @@ "use strict";

}
if (urlLib.parse(options.url).protocol != null) {
const isAbsoluteUrl = urlLib.parse(options.url).protocol != null;
if (isAbsoluteUrl) {
delete options.baseUrl;

@@ -62,7 +63,12 @@ }

// token, and we haven't opted out of refresh
if (auth != null && options.sendToken && options.refreshToken) {
const shouldRefreshKey = yield utils.shouldRefreshKey(auth);
if (shouldRefreshKey) {
if (auth != null &&
options.sendToken &&
options.refreshToken &&
(yield utils.shouldRefreshKey(auth))) {
if (!isAbsoluteUrl) {
yield exports.refreshToken({ baseUrl });
}
if (yield auth.isExpired()) {
throw new errors.BalenaExpiredToken(yield auth.getKey());
}
}

@@ -69,0 +75,0 @@ const authorizationHeader = options.sendToken

@@ -7,2 +7,7 @@ # Change Log

# v11.1.1
## (2020-08-13)
* Stop refreshing the token on absolute urls [Thodoris Greasidis]
# v11.1.0

@@ -9,0 +14,0 @@ ## (2020-07-16)

@@ -75,3 +75,4 @@ /*

}
if (urlLib.parse(options.url).protocol != null) {
const isAbsoluteUrl = urlLib.parse(options.url).protocol != null;
if (isAbsoluteUrl) {
delete options.baseUrl;

@@ -82,7 +83,14 @@ }

// token, and we haven't opted out of refresh
if (auth != null && options.sendToken && options.refreshToken) {
const shouldRefreshKey = await utils.shouldRefreshKey(auth);
if (shouldRefreshKey) {
if (
auth != null &&
options.sendToken &&
options.refreshToken &&
(await utils.shouldRefreshKey(auth))
) {
if (!isAbsoluteUrl) {
await exports.refreshToken({ baseUrl });
}
if (await auth.isExpired()) {
throw new errors.BalenaExpiredToken(await auth.getKey());
}
}

@@ -89,0 +97,0 @@ const authorizationHeader = options.sendToken

{
"name": "balena-request",
"version": "11.1.0",
"version": "11.1.1-no-refresh-on-absolute-url-a61c8bb2a7c144748048e41b201f1ee2f7d6e7c7",
"description": "Balena HTTP client",

@@ -5,0 +5,0 @@ "main": "build/request.js",

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