🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

koa-redirect-loop

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-redirect-loop

Prevent redirect loops with sessions since HTTP referrer header is unreliable

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
43
-64.46%
Maintainers
1
Weekly downloads
 
Created
Source

koa-redirect-loop

build status code coverage code style styled with prettier made with lass license npm downloads

Prevent redirect loops with sessions since HTTP referrer header is unreliable

Note that this package only supports koa-generic-session, since other packages do not expose a save method used in res.end override.

Table of Contents

Install

npm:

npm install koa-redirect-loop

yarn:

yarn add koa-redirect-loop

Usage

const Koa = require('koa');
const session = require('koa-generic-session');
const RedirectLoop = require('koa-redirect-loop');

const redirectLoop = new RedirectLoop({
  defaultPath: '/',
  maxRedirects: 5,
  logger: console
});

const app = new Koa();
app.keys = [ 'secret' ];

app.use(session());
app.use(redirectLoop.middleware);

Options

  • defaultPath (String) - path to fallback to, defaults to '/'
  • maxRedirects (Number) - maximum number of redirects to allow, defaults to 5

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

Keywords

back

FAQs

Package last updated on 23 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts