Skip to content
Myr

Merge branch 'master' of git://github.com/visionmedia/express

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

Conflicts: lib/express/static.js

authored by ciaranj · committed by ciaranj · parents 3ec970b, 3777bfd · Browse files · 4 files+33 added−44 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+33 added−44 removed

  • other:+33 added−44 removed

4 files+33 added−44 removed

modified:lib/express/core.js+2 added-2 removed
198 unmodified lines
199 */200 201 run: function(host, port){202 var self = this203 if (host) this.host = host204 if (port) this.port = port203 if (host !== undefined) this.host = host204 if (port !== undefined) this.port = port205 require('http')206 .createServer(function(request, response){207 request.body = ''208 request.setBodyEncoding('utf8')
62 unmodified lines
modified:lib/express/request.js+9 added-8 removed
169 unmodified lines
170 return this.response.status = code171 },172 173 /**174 * Immediately respond with response _code_ and _body_.174 * Immediately respond with response _code_, _body_ and optional _encoding_.175 * The status _code_ defaults to to 404, and _body_ will176 * default to the default body associated with the response177 * _code_.178 *
1 unmodified line
180 * will be thrown.181 *182 * @param {int} code183 * @param {string} body184 * @param {string} encoding185 * @see statusBodies186 * @api public187 */188188 halt: function(code, body) {189 halt: function(code, body, encoding) {190 this.status(code = code || 404)191 if (body = body || statusBodies[code])191 return this.respond(body)192 return this.respond(body, encoding)193 throw new InvalidStatusCode(code)194 },195 196 /**196 * Respond with _body_.197 * Respond with _body_ and optional _encoding_.198 *198 * @param {Type} Var199 * @return {Type}199 * @param {string} body200 * @param {string} encoding201 * @see Request#halt()202 * @api private203 */204 204 respond: function(body) {205 respond: function(body, encoding) {206 this.response.body = body207 this.trigger('response')208 if (typeof this.response.body != 'string') throw new InvalidResponseBody(this)209 if (typeof this.response.status != 'number') throw new InvalidStatusCode(this.response.status)210 this.response.sendHeader(this.response.status, this.response.headers)210 this.response.sendBody(this.response.body)211 this.response.sendBody(this.response.body, encoding)212 this.response.finish()213 },214 215 /**
41 unmodified lines
modified:lib/express/static.js+15 added-32 removed
modified:Readme.md+7 added-2 removed