Skip to content
Myr

add request.isXHR

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

authored by Aaron Heckmann · committed by Aaron Heckmann · parent 0dfaf01 · Browse files · 1 file+12 added−1 removed
This commit

State

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

Diff stats

1 file+12 added−1 removed

  • other:+12 added−1 removed

1 file+12 added−1 removed

modified:lib/express/request.js+12 added-1 removed
121 unmodified lines
122 accept.indexOf(type.split('/')[0]+'/*') !== -1123 })124 : true125 },126 127 /**128 * Check if the request was an xmlHttpRequest (ajax).129 *130 * @return {bool}131 * @api public132 */133134 get isXHR() {135 return (this.header('X-Requested-With') || '').toLowerCase() === 'xmlhttprequest'136 },137138 /**139 * Set response status to _code_.140 *141 * @param {int} code131 * @return {Request)142 * @return {Request}143 * @api public144 */145146 status: function(code) {
152 unmodified lines