rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Rack::Lint and Set-Cookie
@ 2010-01-29 12:57 agilesoftware
  2010-02-01  5:09 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: agilesoftware @ 2010-01-29 12:57 UTC (permalink / raw)
  To: Rack Development

in Utils.set_cookie_header!(header, key, value)

  case header["Set-Cookie"]
      when Array
        header["Set-Cookie"] << cookie
      when String
        header["Set-Cookie"] = [header["Set-Cookie"], cookie]
      when nil
        header["Set-Cookie"] = cookie
      end

but in Rack::Lint:

    def check_headers(header)
      header.each { |key, value|
         .......
        assert("a header value must be a String, but the value of " +
          "'#{key}' is a #{value.class}") { value.kind_of? String }
        ## consisting of lines (for multiple header values, e.g.
multiple
        ## <tt>Set-Cookie</tt> values) seperated by "\n".
        value.split("\n").each { |item|
          ## The lines must not contain characters below 037.
          assert("invalid header value #{key}: #{item.inspect}") {
            item !~ /[\000-\037]/
          }
        }
      }
    end


So if I have any Set-Cookie header set in my Rack application, Lint
will fail.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-01  5:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-29 12:57 Rack::Lint and Set-Cookie agilesoftware
2010-02-01  5:09 ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).