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

couchdb-auth-proxy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-auth-proxy - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

28

index.js

@@ -11,3 +11,3 @@ 'use strict';

var name = "couchdb-auth-proxy";
var version = "1.1.1";
var version = "1.1.2";

@@ -83,2 +83,8 @@ var asyncToGenerator = function (fn) {

proxy.on("proxyRes", function (proxyRes, req, res) {
const existing = res.getHeader("Via");
const viaheader = `${ existing ? existing + ", " : "" }${ req.httpVersion } ${ via } (${ name }/${ version })`;
res.setHeader("Via", viaheader);
});
return (() => {

@@ -95,22 +101,8 @@ var _ref2 = asyncToGenerator(function* (req, res, next) {

if (ctx != null) {
const name = typeof ctx.name === "string" ? ctx.name : "";
req.headers[headerFields.username] = name;
const n = typeof ctx.name === "string" ? ctx.name : "";
req.headers[headerFields.username] = n;
req.headers[headerFields.roles] = Array.isArray(ctx.roles) ? ctx.roles.join(",") : "";
if (secret) req.headers[headerFields.token] = signRequest(name, secret);
if (secret) req.headers[headerFields.token] = signRequest(n, secret);
}
// attach Via header on response
// do this last in case there was an error
if (via) {
const writeHead = res.writeHead;
res.writeHead = function (code, headers) {
const existing = res.getHeader("Via");
const viaheader = `${ existing ? existing + ", " : "" }${ req.httpVersion } ${ via } (${ name }/${ version })`;
res.setHeader("Via", viaheader);
if (headers) headers["Via"] = viaheader;
return writeHead.apply(res, arguments);
};
}
proxy.web(req, res);

@@ -117,0 +109,0 @@ } catch (e) {

{
"name": "couchdb-auth-proxy",
"version": "1.1.1",
"version": "1.1.2",
"description": "An HTTP reverse proxy library for quick and dirty Couchdb proxy authentication",

@@ -5,0 +5,0 @@ "author": "Tyler Johnson <tyler@tylerjohnson.me>",

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