rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: James Tucker <jftucker@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: rack.hijack response header check is case-insensitive?
Date: Tue, 10 May 2016 22:06:28 -0700	[thread overview]
Message-ID: <CABGa_T8ihnKWwguObGCQqF-qBA+_v1YwM1-2tv3y5ShbWo4scw@mail.gmail.com> (raw)
In-Reply-To: <20160511050451.GA23544@dcvr.yhbt.net>

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

It is case sensitive. Would welcome a spec bug fix patch to declare it so.
On May 10, 2016 10:04 PM, "Eric Wong" <e@80x24.org> wrote:

> The following snippet in lib/rack/handler/webrick.rb seems
> to imply case-insensitivity by downcasing the comparison
> to RACK_HIJACK (defined as "rack.hijack" in lib/rack.rb):
>
>         status, headers, body = @app.call(env)
>         begin
>           res.status = status.to_i
>           headers.each { |k, vs|
>             next if k.downcase == RACK_HIJACK
>
>             if k.downcase == "set-cookie"
>               res.cookies.concat vs.split("\n")
>             else
>
> But I don't see SPEC mentioning case-insensitivity regarding
> "rack." stuff...
>
> Then a few lines down in the same method, it does this:
>
>           io_lambda = headers[RACK_HIJACK]
>
> But the server handler has no idea if "headers" here is the
> case-insensitive Rack::Utils::HeaderHash or not.  Actually,
> SPEC does not even require response headers to respond to a
> #[] method, only #each.
>
> I'm pretty sure it's not a real problem, since I doubt anybody
> would want to capitalize anything starting with "rack.*".
> At least I really hope not; one of the reasons I love Ruby
> is capitalization is uncommon.  CamelCaseMakesMyEyesBleed :*<
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Rack Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rack-devel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 2684 bytes --]

  reply	other threads:[~2016-05-11  5:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  5:04 rack.hijack response header check is case-insensitive? Eric Wong
2016-05-11  5:06 ` James Tucker [this message]
2016-05-12  2:28   ` [PATCH] lint: clarify "rack.hijack" case-sensitivity in response Eric Wong
2016-05-12  2:31     ` [PATCH] webrick: detect partial hijack without hash headers Eric Wong
2016-11-02  0:11       ` Eric Wong
2016-11-05  0:22         ` Aaron Patterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABGa_T8ihnKWwguObGCQqF-qBA+_v1YwM1-2tv3y5ShbWo4scw@mail.gmail.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).