unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: X-Forwarded-Proto / X_FORWARDED_PROTO
Date: Sat, 9 Jan 2010 22:12:09 -0800	[thread overview]
Message-ID: <20100110061209.GA1685@dcvr.yhbt.net> (raw)
In-Reply-To: <201001100045.37677.ibc@aliax.net>

Iñaki Baz Castillo <ibc@aliax.net> wrote:
> El Domingo, 10 de Enero de 2010, skaar escribió:
> > > The Rack (and CGI) specs require that '-' be replaced with '_' for
> > > HTTP header names, so Unicorn is doing the correct thing and treating
> > > it as the same header.
> > 
> > but should it aggregate the values?
> 
> Hi, review my other response in this thread.
> 
> This is undefined. Some headers do allow multiple values separated by comma in 
> the same header with the same meaning as varios headers with same name and 
> single values. But this depends on each header specification.

>From reading rfc 2616, section 4.2 that all multi-value headers can be
combined with commas without changing semantics of the message[1].
There's also no other way (e.g. with an Array) to represent them for
Rack...

[1] In the Real-World(TM), this is not true for Set-Cookie headers in
    HTTP responses.

> In your case it seems valid for me (just an opinnion) as 
> "HTTP_X_FORWARDED_PROTO: http,https" could mean that the request has been sent 
> using HTTPS and an intermediary proxy has forwarded it using HTTP. Of course 
> the final destination (Unicorn application) must be ready to support such 
> syntax.

Is it safe to say that if there's an "https" *anywhere* in the
X-Forwarded-Proto chain, that "rack.url_scheme" should be set to
"https"?   Because I suppose most of the time there's only one
(client-facing) proxy using https.

-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


  reply	other threads:[~2010-01-10  6:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09 22:16 X-Forwarded-Proto / X_FORWARDED_PROTO skaar
2010-01-09 22:33 ` Iñaki Baz Castillo
2010-01-09 22:39 ` Eric Wong
2010-01-09 23:29   ` skaar
2010-01-09 23:45     ` Iñaki Baz Castillo
2010-01-10  6:12       ` Eric Wong [this message]
2010-01-10  6:32         ` Eric Wong
2010-01-10 11:43           ` John-Paul Bader
2010-01-19 21:43           ` Eric Wong

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-all from there: mbox

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

  List information: https://yhbt.net/unicorn/

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

  git send-email \
    --in-reply-to=20100110061209.GA1685@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

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