Ticket #105 (closed defect: duplicate)
empty 'Set-Cookie' header bug
| Reported by: | moumar | Owned by: | somebody |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | camping.rb | Version: | 1.5 |
| Keywords: | Cc: |
Description
camping generate an empty 'Set-Cookie' header that lead to output too much "\r\n" when calling Controller#to_s.
This is ok when dealing with plain text (like HTML) output, but is problematic when generating binary content (like on-the-fly generated images), leading to corrupt files.
Here a patch
--- camping-unabridged.rb 2006-11-01 16:43:15.628963250 +0100
+++ camping_patched.rb 2006-11-01 16:44:37.334069500 +0100
@@ -420,7 +420,7 @@
# on before and after overrides with Camping.
def service(*a)
@body = send(@method, *a) if respond_to? @method
- @headers['Set-Cookie'] = @cookies.map { |k,v| "#{k}=#{C.escape(v)}; path=#{self/"/"}" if v != @k[k] } - [nil]
+ @headers['Set-Cookie'] = @cookies.map { |k,v| "#{k}=#{C.escape(v)}; path=#{self/"/"}" if v != @k[k] } - [nil] unless @cookies.empty?
self
end
Change History
Note: See
TracTickets for help on using
tickets.
