From: Jon Leighton <j@jonathanleighton.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Problem with redirects where a Rack app sits behind a proxy
Date: Sun, 28 Nov 2010 06:21:00 -0800 (PST) [thread overview]
Message-ID: <d1f73ac8-d192-4cf5-a83a-98ac3b9e0239@n2g2000pre.googlegroups.com> (raw)
Hi there,
I have encountered a problem with redirects with Sinatra proxied by
Apache. Basically, the port number of the backend application server
(Mongrel or whatever) will appear in the Location header.
I've done a fairly extensive investigation here: https://github.com/jonleighton/redirect_test
If you read README.md it basically explains everything in detail, but
what it boils down to is this: Rack::Request#port is incorrect, in
that it uses SERVER_PORT when no explicit port is given by
host_with_port.
Rails is not affected, since it implements its own
ActionDispatch::Request#port method. I believe the Rails
implementation is correct and should be implemented in Rack.
If people agree with this analysis then I'm happy to produce a patch
against Rack.
Cheers,
Jon
--
http://jonathanleighton.com/
next reply other threads:[~2010-11-28 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-28 14:21 Jon Leighton [this message]
2010-11-28 14:46 ` Problem with redirects where a Rack app sits behind a proxy Lee Hambley
2010-11-28 15:22 ` Jon Leighton
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=d1f73ac8-d192-4cf5-a83a-98ac3b9e0239@n2g2000pre.googlegroups.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).