diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-24 23:43:08 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-25 00:00:33 +0000 |
commit | 558513bdeaac2bd1feb9df46c3ba09616b1be2bf (patch) | |
tree | 8dce70f8671af7cecf07880a2cbb5284acff2a6d | |
parent | 62621af7c8724f5cc5cc3a6dfcd47eb6654286a5 (diff) | |
download | kcar-558513bdeaac2bd1feb9df46c3ba09616b1be2bf.tar.gz |
Kcar::Parser#extract_trailers never returns a false/nil value, so there's no reason to check for it.
-rw-r--r-- | lib/kcar/response.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/kcar/response.rb b/lib/kcar/response.rb index 4b90883..6f151e5 100644 --- a/lib/kcar/response.rb +++ b/lib/kcar/response.rb @@ -107,9 +107,8 @@ class Response < Struct.new(:sock, :hdr, :unchunk, :buf, :parser) # since Rack does not provide a way to explicitly send trailers # in the response, we'll just yield a stringified version to our # server and pretend it's part of the body. - if trailers = parser.extract_trailers(hdr) - yield(trailers.map! { |k,v| "#{k}: #{v}\r\n" }.join("") << "\r\n") - end + trailers = parser.extract_trailers(hdr) + yield(trailers.map! { |k,v| "#{k}: #{v}\r\n" }.join("") << CRLF) end def each_until_eof(&block) |