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

@trayio/commons

Package Overview
Dependencies
Maintainers
4
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trayio/commons - npm Package Compare versions

Comparing version 4.40.0 to 4.41.0

8

dist/http/Http.js

@@ -30,3 +30,9 @@ "use strict";

const Serialization_1 = require("../serialization/Serialization");
const getHeader = (headers, name) => O.fromNullable(headers[name.toLowerCase()]);
const getHeader = (headers, name) => {
const lowerCasedHeaders = Object.keys(headers).reduce((acc, key) => ({
...acc,
[key.toLowerCase()]: headers[key],
}), {});
return O.fromNullable(lowerCasedHeaders[name.toLowerCase()]);
};
var HttpMethod;

@@ -33,0 +39,0 @@ (function (HttpMethod) {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const O = __importStar(require("fp-ts/Option"));
const Http_1 = require("./Http");

@@ -134,2 +158,20 @@ describe('HttpHeaders', () => {

});
it('should extract bearer token from headers', () => {
const headers = {
'content-type': 'application/json',
'content-length': '100',
authorization: 'bearer 1234',
};
const result = Http_1.HttpHeaders.extractBearerToken(headers);
expect(result).toEqual(O.some('1234'));
});
it('should extract bearer token from headers when headers are capitalized', () => {
const headers = {
'Content-Type': 'application/json',
'Content-Length': '100',
Authorization: 'Bearer 1234',
};
const result = Http_1.HttpHeaders.extractBearerToken(headers);
expect(result).toEqual(O.some('1234'));
});
});

2

package.json
{
"name": "@trayio/commons",
"version": "4.40.0",
"version": "4.41.0",
"description": "Extensions to the standard/core libraries and basic features",

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

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