lib/jubilee/response.rb in jubilee-0.2.0 vs lib/jubilee/response.rb in jubilee-0.2.1

- old
+ new

@@ -34,19 +34,22 @@ def write_status(response) response.statusCode = @status end def write_headers(response) - @headers.each do |key, value| + @headers.each do |key, values| case key when CONTENT_LENGTH - @content_length = value + @content_length = values next when TRANSFER_ENCODING @allow_chunked = false @content_length = nil end - response.putHeader(key, value) + # Multiple values are joined by \n + values.split(NEWLINE).each do |value| + response.putHeader(key, value) + end end end def write_body(response) if @content_length