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

airbits-http-utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airbits-http-utils - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

30

index.js

@@ -12,2 +12,14 @@ var jwt = require("jsonwebtoken");

this.generateOKResponseForLogin = (req, token, body) => {
const origin = filterOrigins(req.headers.origin);
var d = new Date();
d.setTime(d.getTime() + 100*24*60*60*1000);
const expires = "expires="+ d.toUTCString()+ ";";
const cookie = "xens-session="+loginResult.token+ "; Domain=api.beta.xens.io; Path=/; "+expires;
return buildLoginResponse(origin, cookie, body);
}
this.generateErrResponse = (req) =>{

@@ -24,4 +36,17 @@ const origin = filterOrigins(req.headers.origin);

function buildLoginResponse(origin, coookie, body){
return {
"headers": {
"Access-Control-Allow-Origin" : origin, // Required for CORS support to work
"Access-Control-Allow-Credentials" : true,
"Access-Control-Allow-Headers": "Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token",
"Access-Control-Allow-Methods": "DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT",
"Set-Cookie": coookie
},
"statusCode": 200,
"body": JSON.stringify(body)
}
}
function buildResponse(origin, statusCode, body){

@@ -55,3 +80,4 @@ return {

let parts = rawCookies.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
if (parts.length
=== 2) return parts.pop().split(";").shift();
}

@@ -58,0 +84,0 @@

2

package.json
{
"name": "airbits-http-utils",
"version": "1.0.3",
"version": "1.0.4",
"description": "http utilitities for xens project",

@@ -5,0 +5,0 @@ "main": "index.js",

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