A restify formatter that unicode escapes <, >, & as \u003c, \u003e, \u0026 respectively to keep some browsers from misinterpreting it as HTML.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
test
.gitignore
.travis.yml
README.md
index.js
package-lock.json
package.json
yarn.lock

README.md

A restify formatter that unicode escapes <, >, & as \u003c, \u003e, \u0026 respectively to keep some browsers from misinterpreting it as HTML.

Usage:

var restify = require('restify');
var safeJsonFormatter = require('restify-safe-json-formatter');

var server = restify.createServer({
  formatters: {
    'application/json; q=0.9': safeJsonFormatter
  }
});

See also: the example server