[zorp-hu] Zorp http filterURL
SZALAY Attila
sasa@balabit.hu
Thu, 18 Jul 2002 11:24:39 +0200
Hi!
On 2002 Jul 18, Kosa Attila wrote:
> def filterURL(self, method, url, version):
> if (url == "http://webmail.xxx.hu")
> self.request_url = "http://129.184.93.3/"
> return HTTP_REQ_ACCEPT
> if (url == "http://www.xxx.hu")
> return HTTP_REQ_ACCEPT
> if (url == "https://www.xxx.hu")
> return HTTP_REQ_ACCEPT
> self.error_info = "Content denied by policy."
> return HTTP_REQ_REJECT
>
> Jul 17 19:56:06 thewall Http[9042]: zorp version 1.4.3 starting up
> Jul 17 19:56:06 thewall Http[9044]: (zorp/nosession): File "/etc/zorp/test.py", line 37
> Jul 17 19:56:06 thewall Http[9044]: (zorp/nosession): if (url == "http://webmail.xxx.hu")
> Jul 17 19:56:06 thewall Http[9044]: (zorp/nosession): ^
> Jul 17 19:56:06 thewall Http[9044]: (zorp/nosession): SyntaxError: invalid syntax
> Jul 17 19:56:06 thewall Http[9042]: (zorp/nosession): Error opening policy file /etc/zorp/test.py
> Jul 17 19:56:06 thewall Http[9042]: zorp version 1.4.3 going down.
Mint az latszik, a sor vegen van a gondja.
A gond egyebkent az, hogy python-ban a if utan ':'-t kell rakni, ugyanugy
mint def utan, azaz:
def filterURL(self, method, url, version):
if (url == "http://webmail.xxx.hu"):
^
self.request_url = "http://129.184.93.3/"
return HTTP_REQ_ACCEPT
--
Szalay Attila BalaBit IT Biztonságtechnikai Kft.
tel:(36-1)-371-05-40 1116 Bp. Csurgoi ut 20/b
fax:(36-1)-208-08-75 http://www.balabit.hu/