Skip to content
Myr

Added tests for req.is()

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent a2a1aad · Browse files · 2 files+61 added−0 removed
This commit

State

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

Diff stats

2 files+61 added−0 removed

  • tests:+53 added−0 removed
  • other:+8 added−0 removed

2 files+61 added−0 removed

modified:lib/express/request.js+8 added
191 unmodified lines
192 return msgs;193 }194};195196http.IncomingMessage.prototype.is = function(type){197 var contentType = this.headers['content-type'];198 if (!contentType) return;199 if (!type.indexOf('/')) type = mime.type('.' + type);200 return contentType.indexOf(type);201};202203204// Callback for isXMLHttpRequest / xhr205206function isxhr() {207 return this.header('X-Requested-With', '').toLowerCase() === 'xmlhttprequest';
11 unmodified lines
modified:test/request.test.js+53 added