GitXplorerGitXplorer
C

network-error-logging

public
5 stars
5 forks
3 issues

Commits

List of commits on branch main.
Verified
798c0b1949be912626804a81818506e5b6ced75c

chore: bump dependencies

CCherry committed 4 months ago
Verified
449b46121d362251f87b846eed9d037f58a3bca6

chore: bump dependencies

CCherry committed 5 months ago
Verified
a20455e7cc2d156cdf0521b63787755d235e0782

chore: bump dependencies

CCherry committed a year ago
Verified
bed121cddd82ccde43d823b7036e2564c2a5f1d4

chore: bump dependencies

CCherry committed a year ago
Verified
d75d79ec246af34e990b6c8e4b5ad9f9fd2703fb

chore: bump dependencies

CCherry committed a year ago
Verified
09e1b2e32126a0f060554331e41c17ff7bf35f71

Merge pull request #206 from Cherry/chore/bump-dependencies

CCherry committed a year ago

README

The README file for this repository.

Network Error Logging

npm version dependencies Status Actions Status Coverage Status FOSSA Status

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

To use:

const NEL = 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 header
  max_age: 31_536_000, // REQUIRED. seconds
  include_subdomains: true, // OPTIONAL
  success_fraction: 0.5, // OPTIONAL. sampling rate
  failure_fraction: 0.5, // OPTIONAL. sampling rate
  request_headers: ["If-None-Match"], // OPTIONAL. request headers whose names and values are included in the network error reports
  response_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