rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Joshua Peek <josh@joshpeek.com>
To: rack-devel@googlegroups.com
Subject: Re: request path_info being ignored?
Date: Thu, 9 Jul 2009 16:30:02 -0500	[thread overview]
Message-ID: <1c5622660907091430v5ed9455dh6ac3fa9a73eca60b@mail.gmail.com> (raw)
In-Reply-To: <c3dcb251-91f5-4390-91ec-67b6fb7ecaa9@y7g2000yqa.googlegroups.com>


Rails uses request uri instead of path info. I feel this is incorrect,
but its the current behavior. You'll need to update REQUEST_URI as
well.

On Thu, Jul 9, 2009 at 3:21 PM, Mark Larimer<larimer@fantasybowl.com> wrote:
>
> 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
>



-- 
Joshua Peek

      reply	other threads:[~2009-07-09 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 20:21 request path_info being ignored? Mark Larimer
2009-07-09 21:30 ` Joshua Peek [this message]

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=1c5622660907091430v5ed9455dh6ac3fa9a73eca60b@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).