rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: rack-devel@googlegroups.com
Subject: [PATCH] lint: clarify "rack.hijack" case-sensitivity in response
Date: Thu, 12 May 2016 02:28:14 +0000	[thread overview]
Message-ID: <20160512022814.GA8332@dcvr.yhbt.net> (raw)
In-Reply-To: <CABGa_T8ihnKWwguObGCQqF-qBA+_v1YwM1-2tv3y5ShbWo4scw@mail.gmail.com>

Based on my inspection of the webrick handler, it was
ambiguous as to whether "rack.hijack" is supposed to
be case-sensitive or not. Thankfully James cleared it up:

http://mid.gmane.org/CABGa_T8ihnKWwguObGCQqF-qBA+_v1YwM1-2tv3y5ShbWo4scw@mail.gmail.com

Note: I manually reapplied the SPEC change in
commit 72185735ad0c3aea4e37ab66b0c370e42180df39
("Fixed link and rack.session's indentation in SPEC")
after regenerating it from lint.rb
---
  James Tucker <jftucker@gmail.com> wrote:
  > It is case sensitive. Would welcome a spec bug fix patch to declare it so.

  If you prefer to pull:

  The following changes since commit 9073125f71afd615091f575d74ec468a0b1b79bf:

    bumping version (2016-05-06 15:51:18 -0500)

  are available in the git repository at:

    git://80x24.org/rack.git lint-case-sens

  for you to fetch changes up to daef95d81b1c3b4dfe3e955d5f34d1be569d86b0:

    lint: clarify "rack.hijack" case-sensitivity in response (2016-05-12 02:06:36 +0000)

  ----------------------------------------------------------------
  Eric Wong (1):
        lint: clarify "rack.hijack" case-sensitivity in response

 SPEC             | 3 ++-
 lib/rack/lint.rb | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/SPEC b/SPEC
index 7e3af40..a5999b3 100644
--- a/SPEC
+++ b/SPEC
@@ -200,7 +200,8 @@ have been sent.
 In order to do this, an application may set the special header
 <tt>rack.hijack</tt> to an object that responds to <tt>call</tt>
 accepting an argument that conforms to the <tt>rack.hijack_io</tt>
-protocol.
+protocol.  Unlike normal response headers, <tt>rack.hijack</tt>
+is case-sensitive.
 After the headers have been sent, and this hijack callback has been
 called, the application is now responsible for the remaining lifecycle
 of the IO. The application is also responsible for maintaining HTTP
diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb
index 54d3782..6eb2476 100644
--- a/lib/rack/lint.rb
+++ b/lib/rack/lint.rb
@@ -573,7 +573,8 @@ def check_hijack_response(headers, env)
       ## In order to do this, an application may set the special header
       ## <tt>rack.hijack</tt> to an object that responds to <tt>call</tt>
       ## accepting an argument that conforms to the <tt>rack.hijack_io</tt>
-      ## protocol.
+      ## protocol.  Unlike normal response headers, <tt>rack.hijack</tt>
+      ## is case-sensitive.
       ##
       ## After the headers have been sent, and this hijack callback has been
       ## called, the application is now responsible for the remaining lifecycle
-- 
EW

-- 

--- 
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.

  reply	other threads:[~2016-05-12  2:28 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
2016-05-12  2:28   ` Eric Wong [this message]
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=20160512022814.GA8332@dcvr.yhbt.net \
    --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).