I have created a 2 zClasses, one that is a CatalogAware File, one that is a CatalogAware Page Template. I recently noticed a most peculiar problem. Mozilla browsers cannot "Save Link As..." any content that is one of these zClasses "The Link Could Not Be Saved. The Web Page Might Have Been Moved or Renamed". Perusing the logs, I'm noticing that Mozilla browsers HEAD the files before they try to download them. Medusa returns 405 - Method Not Allowed for this command on these zClasses. Internet Explorer just skips straight to the GET, which works fine. How can I fix this? I have some idea where a HEAD method would need to go, but I'm not really sure what should be in it. Ed
Edward Pollard wrote at 2004-2-17 14:06 -0700:
... Perusing the logs, I'm noticing that Mozilla browsers HEAD the files before they try to download them. Medusa returns 405 - Method Not Allowed for this command on these zClasses.
Look at the code to find out why "HEAD" is not supported. -- Dieter
Hello Dieter, I've had to come back to this problem as our new search engine uses HEAD to get document titles. Working with zClasses, one is rather abstracted from the code. I'm not sure how to start "look[ing] at the code" to solve this problem. When I had problems with FTP it was due to my zClass not inheriting certain methods properly from PageTemplate (recall these zClasses. With the help of the list I solved the problem as so: def getPageTemplateClass(self): clist = self.__class__.__bases__ for superc in clist: if superc.__name__ == 'ZopePageTemplate': return superc return self.__class__ def manage_FTPput(self,REQUEST): ptClass = getPageTemplateClass(self) return ptClass.manage_FTPput(self,REQUEST) I've done a search of the source code, but cannot find the equivalent function for a HEAD request. Can you help? (While were on the subject, my zClasses don't work with WebDAV either. Could this approach be extended to whatever methods WebDAV uses?) --- Edward J. Pollard, B.Sc Webmaster, University of Lethbridge On Feb 18, 2004, at 1:12 PM, Dieter Maurer wrote:
Edward Pollard wrote at 2004-2-17 14:06 -0700:
... Perusing the logs, I'm noticing that Mozilla browsers HEAD the files before they try to download them. Medusa returns 405 - Method Not Allowed for this command on these zClasses.
Look at the code to find out why "HEAD" is not supported.
-- Dieter
Edward Pollard wrote at 2004-4-23 09:43 -0600:
Hello Dieter,
I've had to come back to this problem as our new search engine uses HEAD to get document titles.
Working with zClasses, one is rather abstracted from the code. I'm not sure how to start "look[ing] at the code" to solve this problem.
Try to define a "HEAD" method for your ZClasses. -- Dieter
On Apr 23, 2004, at 2:00 PM, Dieter Maurer wrote:
Edward Pollard wrote at 2004-4-23 09:43 -0600:
Hello Dieter,
I've had to come back to this problem as our new search engine uses HEAD to get document titles.
Working with zClasses, one is rather abstracted from the code. I'm not sure how to start "look[ing] at the code" to solve this problem.
Try to define a "HEAD" method for your ZClasses.
Unlike FTP, I have not been able to determine how HEAD gets handled. Writing a script called HEAD in the same place I added my FTP changes doesn't seem to get called. Of course, even if it was getting called, I wouldn't have the foggiest idea what to do with it. I've been looking through the source code, but cannot find examples of HEAD requests being handled (even though Page Templates and DTML Documents do, indeed, handle them). Can you provide any insight as to where these functions lie? I also am unclear as to why HEAD requests are not being handled by the parent class to my ZClass, although I think it might be because I had to add in CatalogAware before PageTemplate. --- Edward J. Pollard, B.Sc Webmaster<
<table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50" rowspan="5"> </td> <td width="350"><img src="images/top_bottom.gif" width="350" height="16"></td>
</tr> <tr> <td><a href="javascript:;" onMouseOver="MM_swapImage('BOG','','images/BOG-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/BOG.gif" alt="Board of Governors" name="BOG" width="350" height="37" border="0" id="BOG"></a></td> </tr> <tr> <td><a href="javascript:;" onMouseOver="MM_swapImage('Senate','','images/Senate-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/Senate.gif" alt="Senate" name="Senate" width="350" height="42" border="0" id="Senate"></a></td> </tr> <tr> <td><a href="javascript:;" onMouseOver="MM_swapImage('GFC','','images/GFC-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="images/GFC.gif" alt="General Faculties Council" name="GFC" width="350" height="39" border="0" id="GFC"></a></td> </tr>
<tr> <td><img src="images/top_bottom.gif" width="350" height="16"></td> </tr> </table>
My F-Key macros got crossed and somehow pasted my clipboard into my last outgoing message - and then promptly sent it. Apologies for the non-sequitorial HTML. --- Edward J. Pollard, B.Sc Webmaster, University of Lethbridge
Edward Pollard wrote at 2004-4-26 13:22 -0600:
... Unlike FTP, I have not been able to determine how HEAD gets handled. Writing a script called HEAD in the same place I added my FTP changes doesn't seem to get called.
When your ZClass has a "HEAD" method, it should be called for "HEAD" requests (at least, I would be surprised if that were wrong. I did not check, though).
Of course, even if it was getting called, I wouldn't have the foggiest idea what to do with it. I've been looking through the source code, but cannot find examples of HEAD requests being handled (even though Page Templates and DTML Documents do, indeed, handle them). Can you provide any insight as to where these functions lie?
The "default" implementation comes from "webdav.Resource.Resource.HEAD". -- Dieter
participants (2)
-
Dieter Maurer -
Edward Pollard