# File lib/rack/adapter/rails.rb, line 103
          def header(options = "text/html")
            if options.is_a?(String)
              @response['Content-Type']     = options unless @response['Content-Type']
            else
              @response['Content-Length']   = options.delete('Content-Length').to_s if options['Content-Length']
            
              @response['Content-Type']     = options.delete('type') || "text/html"
              @response['Content-Type']    += "; charset=" + options.delete('charset') if options['charset']
                        
              @response['Content-Language'] = options.delete('language') if options['language']
              @response['Expires']          = options.delete('expires') if options['expires']

              @response.status              = options.delete('Status') if options['Status']
              
              # Convert 'cookie' header to 'Set-Cookie' headers.
              # Because Set-Cookie header can appear more the once in the response body, 
              # we store it in a line break seperated string that will be translated to
              # multiple Set-Cookie header by the handler.
              if cookie = options.delete('cookie')
                cookies = []
                
                case cookie
                  when Array then cookie.each { |c| cookies << c.to_s }
                  when Hash  then cookie.each { |_, c| cookies << c.to_s }
                  else            cookies << cookie.to_s
                end
                
                @output_cookies.each { |c| cookies << c.to_s } if @output_cookies
                
                @response['Set-Cookie'] = [@response['Set-Cookie'], cookies].compact
                # See http://groups.google.com/group/rack-devel/browse_thread/thread/e8759b91a82c5a10/a8dbd4574fe97d69?#a8dbd4574fe97d69
                if Thin.ruby_18?
                  @response['Set-Cookie'].flatten!
                else
                  @response['Set-Cookie'] = @response['Set-Cookie'].join("\n")
                end
              end
              
              options.each { |k,v| @response[k] = v }
            end
            
            ""
          end