Skip to content
Myr

use escape-html module to escape html

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Another util bites the dust.

authored by Roman Shtylman · committed by Roman Shtylman · parent 718e68f · Browse files · 4 files+3 added−25 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+3 added−25 removed

  • tests:+0 added−7 removed
  • other:+3 added−18 removed

4 files+3 added−25 removed

modified:lib/response.js+2 added-2 removed
4 unmodified lines
5var http = require('http')6 , path = require('path')7 , connect = require('connect')8 , mixin = require('utils-merge')9 , utils = connect.utils9 , escapeHtml = require('escape-html')10 , sign = require('cookie-signature').sign11 , normalizeType = require('./utils').normalizeType12 , normalizeTypes = require('./utils').normalizeTypes13 , etag = require('./utils').etag
691 unmodified lines
705 body = statusCodes[status] + '. Redirecting to ' + encodeURI(url);706 },707708 html: function(){709 var u = utils.escape(url);709 var u = escapeHtml(url);710 body = '<p>' + statusCodes[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>';711 },712713 default: function(){
87 unmodified lines
modified:lib/utils.js-16 removed
modified:test/utils.js-7 removed
39 unmodified lines
40 utils.flatten(arr)41 .should.eql(['one', 'two', 'three', 'four', 'five']);42 })43})4445describe('utils.escape(html)', function(){46 it('should escape html entities', function(){47 utils.escape('<script>foo & "bar"')48 .should.equal('&lt;script&gt;foo &amp; &quot;bar&quot;')49 })50})
modified:package.json+1 added
32 unmodified lines
33 "send": "0.1.4",34 "cookie-signature": "1.0.1",35 "merge-descriptors": "0.0.1",36 "utils-merge": "1.0.0",37 "escape-html": "1.0.1",38 "debug": ">= 0.7.3 < 1"39 },40 "devDependencies": {41 "ejs": "~0.8.4",
30 unmodified lines