I see in the code for CookieCrumbler.modifyRequest() that it disables cookies if the HTTP method is not GET, PUT, or POST. Specifically this means that it won't accepct cookie auth for HEAD requests. This is causing problems on my site for users with some browsers. Apparently some browsers (recent Mozillas, maybe others) send a HEAD request when the user right-clicks a link and selects "Save link target as" (presumably to gather information before starting the download). So any links that are restricted to authenticated users have the strange behavior that users can left-click and view the file directly, but if they right-click instead they get the Zope Basic auth dialog. Not at all the desired behavior :) Is there a particular reason why HEAD was omitted from the list in modifyRequest()? Could it be added in? Thanks -- Brent ------------------------------------------------------------------------- "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures." -- Frederick Brooks, Jr., The Mythical Man Month
Brent M Hendricks wrote:
I see in the code for CookieCrumbler.modifyRequest() that it disables cookies if the HTTP method is not GET, PUT, or POST. Specifically this means that it won't accepct cookie auth for HEAD requests. This is causing problems on my site for users with some browsers.
Apparently some browsers (recent Mozillas, maybe others) send a HEAD request when the user right-clicks a link and selects "Save link target as" (presumably to gather information before starting the download). So any links that are restricted to authenticated users have the strange behavior that users can left-click and view the file directly, but if they right-click instead they get the Zope Basic auth dialog. Not at all the desired behavior :)
Is there a particular reason why HEAD was omitted from the list in modifyRequest()?
No.
Could it be added in?
Yes. boolean-replies-only-y'rs, Shane
Shane Hathaway wrote:
Brent M Hendricks wrote:
I see in the code for CookieCrumbler.modifyRequest() that it disables cookies if the HTTP method is not GET, PUT, or POST. Specifically this means that it won't accepct cookie auth for HEAD requests. This is causing problems on my site for users with some browsers. Could it be added in?
Yes.
Cool, thanks for reply. If I send in the 1-line patch is there a chance of it getting applied on the 2.6/2.7 branch? --Brent
Brent Hendricks wrote:
Shane Hathaway wrote:
Brent M Hendricks wrote:
I see in the code for CookieCrumbler.modifyRequest() that it disables cookies if the HTTP method is not GET, PUT, or POST. Specifically this means that it won't accepct cookie auth for HEAD requests. This is causing problems on my site for users with some browsers. Could it be added in?
Yes.
Cool, thanks for reply. If I send in the 1-line patch is there a chance of it getting applied on the 2.6/2.7 branch?
CookieCrumbler isn't a part of core Zope. Send me the patch and I'll include it in CMF and the standalone product. Shane
Shane Hathaway wrote:
Brent Hendricks wrote:
Cool, thanks for reply. If I send in the 1-line patch is there a chance of it getting applied on the 2.6/2.7 branch?
CookieCrumbler isn't a part of core Zope. Send me the patch and I'll
Errr yeah, I knew that :)
include it in CMF and the standalone product.
OK, Attaching. Thanks! --Brent Index: CookieCrumbler.py =================================================================== RCS file: /cvs-repository/Products/CookieCrumbler/CookieCrumbler.py,v retrieving revision 1.12 diff -u -r1.12 CookieCrumbler.py --- CookieCrumbler.py 19 Feb 2003 19:03:20 -0000 1.12 +++ CookieCrumbler.py 24 Apr 2003 22:33:18 -0000 @@ -123,7 +123,7 @@ if req.__class__ is not HTTPRequest: return ATTEMPT_DISABLED - if not req[ 'REQUEST_METHOD' ] in ( 'GET', 'PUT', 'POST' ): + if not req[ 'REQUEST_METHOD' ] in ( 'HEAD', 'GET', 'PUT', 'POST' ): return ATTEMPT_DISABLED if req.environ.has_key( 'WEBDAV_SOURCE_PORT' ):
participants (4)
-
Brent Hendricks -
Brent Hendricks -
Brent M Hendricks -
Shane Hathaway