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

csurf

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csurf - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

5

HISTORY.md

@@ -0,1 +1,6 @@

1.6.0 / 2014-09-03
==================
* set `code` property on CSRF token errors
1.5.0 / 2014-08-24

@@ -2,0 +7,0 @@ ==================

1

index.js

@@ -236,3 +236,4 @@ /*!

err.status = 403
err.code = 'EBADCSRFTOKEN'
throw err
}

4

package.json
{
"name": "csurf",
"description": "CSRF token middleware",
"version": "1.5.0",
"version": "1.6.0",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",

@@ -17,3 +17,3 @@ "contributors": [

"devDependencies": {
"body-parser": "~1.5.2",
"body-parser": "~1.7.0",
"connect": "3",

@@ -20,0 +20,0 @@ "cookie-parser": "~1.3.1",

@@ -56,2 +56,11 @@ # csurf

app.use(csrf())
// error handler
app.use(function (err, req, res, next) {
if (err.code !== 'EBADCSRFTOKEN') return next(err)
// handle CSRF token errors here
res.status(403)
res.send('session has expired or form tampered with')
})
```

@@ -69,3 +78,3 @@

[coveralls-url]: https://coveralls.io/r/expressjs/csurf?branch=master
[downloads-image]: http://img.shields.io/npm/dm/csurf.svg?style=flat
[downloads-image]: https://img.shields.io/npm/dm/csurf.svg?style=flat
[downloads-url]: https://npmjs.org/package/csurf
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