[Zope] FTP and REQUEST

Chris Withers chrisw@nipltd.com
Thu, 13 Apr 2000 11:11:32 +0100


Okay, I've finally got this figured out, and it's not SiteAccess that is at fault...

It's actually the Access Rule that needed adjusting to stop it breaking FTP:

<dtml-in virtual_hosts>
<dtml-if "_.string.lower(REQUEST.environ['HTTP_HOST'])==_.string.lower(_['sequence-item'])">
 <dtml-call "REQUEST.setURL(path='/')">
</dtml-if>
</dtml-in>

works great over the web, but fails over FTP. The reason:
Well, it's a bit of a "D'oh!", but an FTP REQUEST isn't going to have an 'environ' key, since it has
no HTTP environment!
This causes an exception, which the FTP server returns as the directory not existing...

So, I've got it working, by wrapping the above in:

<dtml-if "REQUEST.has_key('environ')">

which does raise the question of what is going to be present in a REQUEST object, depending on what
interface
(HTTP, XML-RPC, FTP, WebDav, etc) is being used? Are there any cases where the REQUEST object
doesn't exist at all?

I guess this is something for the interfaces Wiki, which I would have a look at but www.zope.org
seems to be down (pinging it shows this to be true...) 

Any idea when it's going to be back up?

Cheers for the great product, sorry for any misplaced finger pointing ;-)

Chris