problem with profile, explain, select #22

Closed
ebertech opened this Issue Sep 11, 2010 · 5 comments

Comments

Projects
None yet
2 participants
@ebertech

noticed that profile, explain and select in the queries tab are broken. The reason is in bug.rb you've got a condition:

if toolbar_requested? && ip_authorized? && password_authorized? && !@original_request.xhr?
@toolbar.call(env)
else
@app.call(env)
end

but the requests are xhr requests so they get sent to the app and the app says 404. My solution is:

         if toolbar_requested? && ip_authorized? && password_authorized? && non_toolbar_xhr?
          @toolbar.call(env)
        else
          @app.call(env)
        end
      end

    private 

      def non_toolbar_xhr?
        !@original_request.xhr? || @original_request.path =~ /^\/__rack_bug__/
      end
@lukemelia

This comment has been minimized.

Show comment Hide comment
@lukemelia

lukemelia Sep 11, 2010

Collaborator

I think your solution makes sense. Would you mind packaging it up with a test and a patch?

Collaborator

lukemelia commented Sep 11, 2010

I think your solution makes sense. Would you mind packaging it up with a test and a patch?

@ebertech

This comment has been minimized.

Show comment Hide comment
@ebertech

ebertech Sep 11, 2010

Hi,

Here's the patch: http://gist.github.com/575682
Here's the patch to the spec: http://gist.github.com/575687

There's already a test in there that makes sure XHR requests aren't modified and this just makes all of the SQL panel tests send in :xhr => true. I reran the tests and they all pass.

Hi,

Here's the patch: http://gist.github.com/575682
Here's the patch to the spec: http://gist.github.com/575687

There's already a test in there that makes sure XHR requests aren't modified and this just makes all of the SQL panel tests send in :xhr => true. I reran the tests and they all pass.

@lukemelia

This comment has been minimized.

Show comment Hide comment
@lukemelia

lukemelia Sep 12, 2010

Collaborator

Looks good. I'll get it applied after dinner. Thanks! Would you like to be credited as "ebertech" or another name?

Collaborator

lukemelia commented Sep 12, 2010

Looks good. I'll get it applied after dinner. Thanks! Would you like to be credited as "ebertech" or another name?

@ebertech

This comment has been minimized.

Show comment Hide comment
@ebertech

ebertech Sep 12, 2010

Hi, ebertech is fine.

Hi, ebertech is fine.

@lukemelia

This comment has been minimized.

Show comment Hide comment
@lukemelia

lukemelia Sep 12, 2010

Collaborator

Applied in f15849b. Thanks.

Collaborator

lukemelia commented Sep 12, 2010

Applied in f15849b. Thanks.

filiptepper pushed a commit to filiptepper/rack-bug that referenced this issue May 23, 2011

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment