From: Mark Larimer <larimer@fantasybowl.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: request path_info being ignored?
Date: Thu, 9 Jul 2009 13:21:55 -0700 (PDT) [thread overview]
Message-ID: <c3dcb251-91f5-4390-91ec-67b6fb7ecaa9@y7g2000yqa.googlegroups.com> (raw)
I've got Rack fronting a Rails 2.3.2 app. And I wrote some Rack
middleware to do a simple rewrite of the request url. Here is a
simplified version of the call() method:
def call(env)
req = Rack::Request.new(env)
req.path_info = "/people/12345/accounts.xml"
@app.call(env)
end
When Rack operates on this request and passes control through to the
Rails app, I expect the Rails router to call the index method of the
accounts controller...but instead the path_info that was set in the
middleware method is being completely ignored, and Rails is routing
based on the original path.
If I look at env['PATH_INFO'] after the req.path_info=() call, it
shows the new value.
What am I missing?
Thanks.
--mark
next reply other threads:[~2009-07-09 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 20:21 Mark Larimer [this message]
2009-07-09 21:30 ` request path_info being ignored? Joshua Peek
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=c3dcb251-91f5-4390-91ec-67b6fb7ecaa9@y7g2000yqa.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).