Skip to content
Browse files

Headers variable was being shadowed. Bad.

  • Loading branch information...
1 parent b90250d commit f2396990b345f4bb21c55072c73b926e53fda174 @majek majek committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/webjs.coffee
View
4 src/webjs.coffee
@@ -47,9 +47,10 @@ class WebJS
if typeof res.writeHead is "undefined"
# TODO: this is quite obviously wrong.
headers = []
- res.writeHead = (status, headers, content) ->
+ res.writeHead = (status, user_headers, content) ->
r = []
r.push('HTTP/'+req.httpVersion+ ' '+status+' '+http.STATUS_CODES[status])
+ r = r.concat(user_headers)
r = r.concat(headers)
r.push('')
if content
@@ -58,6 +59,7 @@ class WebJS
res.write(r.join('\r\n'))
catch e
null
+
res.setHeader = (k, v) -> headers.push(k+': '+v)
req.start_date = new Date()
funs = funs[0..]

0 comments on commit f239699

Please sign in to comment.
Something went wrong with that request. Please try again.