Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
csrf-monkey
Advanced tools
Automatically add CSRF headers to all clientside requests
npm install --save csrf-monkey
Default behaviour
Put your csrf token in a meta tag in your head like so:
<html>
<head>
<meta name='csrf-token' content='value'>
</head>
<body></body>
</html>
Then call csrf-monkey
. This will patch xhr and window.fetch so that your csrf token is automatically included in all clientside requests
var axios = require('axios')
require('csrf-monkey')()
fetch('/api') // request will include csrf header ('x-csrf-token': value)
axios.get('/api') // request will include csrf header ('x-csrf-token': value)
var csrfMonkey = require('csrf-monkey')
csrfMonkey(header, token)
// you can also pass a custom header to csrf-monkey:
csrfMonkey('my-custom-csrf-header')
// and you can pass your csrf token value directly to csrf-monkey if you don't want to include it as a meta tag:
csrfMonkey(null, 'my-csrf-token')
var restore = csrfMonkey()
restore() // Restores everything back to how it was
csrf-xhr
FAQs
Automatically add CSRF headers to all clientside requests
We found that csrf-monkey demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.