diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-05 16:14:07 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-05 16:14:07 -0800 |
commit | 950b4ba1454543de492efffdf4022f481ca7e4c2 (patch) | |
tree | 90874abdd85fa2f49620134836a9cc714e019780 | |
parent | 4768850390bb1d1e3c2e36273e9aad953e18de19 (diff) | |
download | rainbows-950b4ba1454543de492efffdf4022f481ca7e4c2.tar.gz |
Believe it or not, Time#httpdate showed up at the top of my profiler output for the past couple of years now. I guess that's what happens when all HTTP applications I write are less complex than Rack::Lobster :P
-rw-r--r-- | lib/rainbows/response.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb index b624ea2..9a46659 100644 --- a/lib/rainbows/response.rb +++ b/lib/rainbows/response.rb @@ -1,10 +1,7 @@ # -*- encoding: binary -*- # :enddoc: -require 'time' # for Time#httpdate - module Rainbows::Response - CRLF = Unicorn::HttpResponse::CRLF - CODES = Unicorn::HttpResponse::CODES + include Unicorn::HttpResponse Close = "close" KeepAlive = "keep-alive" @@ -22,7 +19,7 @@ module Rainbows::Response @hp.headers? or return status = CODES[status.to_i] || status buf = "HTTP/1.1 #{status}\r\n" \ - "Date: #{Time.now.httpdate}\r\n" \ + "Date: #{httpdate}\r\n" \ "Status: #{status}\r\n" \ "Connection: #{alive ? KeepAlive : Close}\r\n" headers.each do |key, value| |