Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

HTTP Digest auth uses wrong request method for PUT, DELETE

#2490

Browsers do not support the PUT or DELETE methods, so the _method parameter is used in forms to simulate these. The browser submits the form using POST.

The problem is that the MethodOverride class replaces REQUEST_METHOD in the environment with the intended one. When the browser builds the HTTP_AUTHORIZATION header for HTTP Digest authentication, it does so knowing it will submit using POST. Validation fails, however, because Rails is using PUT or DELETE instead.

HTTP Digest authentication should first check for the presence of rack.methodoverride.original_method in the environment and use that before using REQUEST_METHOD.

Reported by Steve Madsen · April 14th, 2009 @ 07:46 PM

State: resolved
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Steve Madsen
  2. Pratik
    Pratik
    • State changed from new to incomplete

    Hey Steve,

    The tests still fail even after applying the patch.

    May 17th, 2009 @ 07:25 PM

  3. Steve Madsen
    Steve Madsen

    Hi, Pratik. I just looked at this again, on branch origin/2-3-stable. Without my patch to http_authentication.rb, the new test case still fails for me and passes with the patch.

    I'd like to get this applied. Would you give me a little more information about what is failing for you?

    May 18th, 2009 @ 03:50 PM

  4. Pratik
    Pratik

    Oops, sorry. I had commented a line from your test.

    May 18th, 2009 @ 03:58 PM

  5. Repository
  6. Repository