Skip to content

Repository files navigation

Network Error Logging

npm versiondependencies StatusActions StatusCoverage StatusFOSSA Status

This is Express middleware to set the NEL HTTP response header. You can read more about it here.

To use:

constNEL=require('network-error-logging')// ...app.use(NEL({report_to: 'endpoint-1',// REQUIRED to register. OPTIONAL if intention is to remove a previous registration. defined in the Report-To headermax_age: 31_536_000,// REQUIRED. secondsinclude_subdomains: true,// OPTIONALsuccess_fraction: 0.5,// OPTIONAL. sampling ratefailure_fraction: 0.5,// OPTIONAL. sampling raterequest_headers: ["If-None-Match"],// OPTIONAL. request headers whose names and values are included in the network error reportsresponse_headers: ["ETag"]// OPTIONAL. response headers whose names and values are included in the network error reports}))

For further documentation on each field, see https://w3c.github.io/network-error-logging/#nel-response-header.

This header is best set with a previously defined Report-To group. This module is a great way to do that.

https://report-uri.com/ is a great reporting platform for monitoring CSP, NEL, etc. error logs.

License

FOSSA Status

About

Middleware for setting the NEL HTTP response header

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages