Validate options.status before pass it to res.statusCode. #841

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@mengxy

Developers may pass an status variable which is not valid HTTP Status code, but an object contains some other variables). We should not pass status like this to res.statusCode.

@tj tj commented on the diff Sep 21, 2011
lib/view.js
@@ -306,7 +305,7 @@ res.partial = function(view, options, fn){
*/
res.render = function(view, opts, fn, parent, sub){
- // support callback function as second arg
+ // support callback function as second annrg
@tj
tj Sep 21, 2011

narggg! haha

:)

I like the change I'll merge it in thanks

@jonathanong
expressjs member

@visionmedia did you still want to merge something like this? i have two issues with it:

  • Node only supports status codes that are in the specs.
  • It fails silently if users set an invalid status code. it should at least throw a console.warn()
@tj
expressjs member
tj commented Sep 7, 2013

3.0 doesn't support .status anymore (maybe it did at the beginning I forget now), should be good to close

@tj tj closed this Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment