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

are-you-a-cop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

are-you-a-cop

Blocks cops from visiting your site. If they are they have to tell you.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

are-you-a-cop NPM version Downloads Support us

Information

Packageare-you-a-cop
DescriptionBlocks cops from visiting your site. If they are they have to tell you.
Node Version>= 0.10

Usage

var copCheck = require('are-you-a-cop');
var express = require('express');
var app = express();

app.use(copCheck(false));

app.get('/safezone', function(req, res, next){
  
});

Want to allow cops but still mark the request as .cop = true? Set the allow param to true.

app.use(copCheck(true));

How does this work?

Around the world there is one universal constant: If you ask a cop if they are a cop, they have to tell you. What this module does is attach an "X-Are-You-A-Cop" header (RFC520520) to each response. If the requesting party sends back a "X-I-Am-A-Cop" header the request will be flagged as a cop, and you can choose to allow or deny it. Normal users will not be affected by this, but all cops will need to modify their browser to send this legally mandated header.

Like what we do?

FAQs

Package last updated on 28 Jul 2014

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

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