minad / rack-esi

Unmaintained: An implementation of a small (but still very useful!) subset of ESI for Rack
Other
7 stars 2 forks source link

Query Param Support #2

Open btab opened 13 years ago

btab commented 13 years ago

Hiya,

A rails route like '/foo/bar' will not be matched by an internal ESI request if it has a query param on the end as I believe the internally-constructed rack request isn't handling query strings correctly.

So /foo/bar works fine. /foo/bar?baz=42 doesn't inside the ESI logic but does from the outside.

Since we only use Rack::ESI in development, I've monkeypatched like this to let Rack do all the heavy lifting for us...

module Rack
  class ESI
    def get_local_fragment(env, src)
      get_remote_fragment(env, "http://#{env['HTTP_HOST']}/#{src}")
    end
  end
end