Problem with Zope and Proxy server
I do most of my network access through a firewall with a Netscape Suitespot Proxy server and I now have a Zope 2.0 Beta 3 system set up outside the firewall. Mostly it works fine, but I find that attempting to submit a form with a POST method always fails with Error 400 (Not Found). This happens with any form I create but only if I use POST (changing the submit method to GET and it all works fine) and only if I access Zope via the proxy. The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen. Can anyone suggest what is happening here?
On Fri, 13 Aug 1999, Duncan Booth wrote:
I do most of my network access through a firewall with a Netscape Suitespot Proxy server and I now have a Zope 2.0 Beta 3 system set up outside the firewall. Mostly it works fine, but I find that attempting to submit a form with a POST method always fails with Error 400 (Not Found). This happens with any form I create but only if I use POST (changing the submit method to GET and it all works fine) and only if I access Zope via the proxy.
The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen.
Can anyone suggest what is happening here? Well, your proxy server is broken? It seems to work well enough with Apache Proxy and Squid :)
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
On Fri, 13 Aug 1999, Duncan Booth wrote:
The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen.
Can anyone suggest what is happening here? Well, your proxy server is broken? It seems to work well enough with Apache Proxy and Squid :)
Fair enough, I suspect the problem is indeed with the proxy server, but the proxy server has no problems with POSTing to things other than Zope, and I don't want to block out people from my site just because they have a naff proxy server. I also have a report that IE3 cannot download files from my site. This may be the fault of IE3, but I still want to get it to work even if it isn't technically my code or Zope at fault. -- Duncan Booth duncan@dales.rmplc.co.uk int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3" "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure? http://dales.rmplc.co.uk/Duncan
On Mon, 16 Aug 1999, Duncan Booth wrote:
On Fri, 13 Aug 1999, Duncan Booth wrote:
The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen.
Can anyone suggest what is happening here? Well, your proxy server is broken? It seems to work well enough with Apache Proxy and Squid :)
Fair enough, I suspect the problem is indeed with the proxy server, but the proxy server has no problems with POSTing to things other than Zope, and I don't want to block out people from my site just because they have a naff proxy server. Well, you could always put some logging proxies after and before your proxy, and compare what element of Zope make it misfunction. Afterwards, one would have to decide if it is possible to fix, without breaking Zope's standard conformity.
I also have a report that IE3 cannot download files from my site. This may be the fault of IE3, but I still want to get it to work even if it isn't technically my code or Zope at fault. Well, what exactly happens?
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
On Fri, 13 Aug 1999, Duncan Booth wrote:
The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen.
I put some debug logging into medusa to dump everything sent or received by Zope. Now I can see exactly what the difference is between using the proxy server and going direct, and it looks to me like a problem with Zope, but I don't know for sure and would appreciate some advice. In the following dump accesses to www.rcp.co.uk are direct, dales.rmplc.co.uk is accessed via the proxy. The data is exactly as I logged it, except that I have obscured part of the authentication string. The first POST request is via the proxy and Zope rejects it as a bad request. The second POST is direct and is accepted. Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:0> 'POST /Test/result HTTP/1.0\015\012Referer: http://dales.rmplc.co.uk:9080/Test/Post\015\012User-Agent: Mozilla/4.61 [en] (WinNT; I)\015\012Host: dales.rmplc.co.uk:9080\015\012Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\015\012Accept-Encoding: gzip\015\012Accept-Language: en\015\012Accept-Charset: iso- 8859-1,*,utf-8\015\012Cookie: SITESERVER=ID=97bdddbc2a4167ada362fe751304c5a4; RMID=c29a124837947b70\015\012Content-type: application/x-www- form-urlencoded\015\012Content-length: 9\015\012Forwarded: by http://duraluminium.rcp.co.uk:8080 (Netscape- Proxy/3.5)\015\012\015\012' Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> 'value=123\015\012\015\012\000' Send <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> 'HTTP/None 400 Bad Request\015\012Server: Medusa/1.10\015\012Content-Type: text/html\015\012Content- Length: 136\015\012Date: Tue, 17 Aug 1999 09:20:19 GMT\015\012\015\012<head>\015\012<title>Error response</title>\015\012</head>\015\012<body>\015\012<h1>Error response</h1>\015\012<p>Error code 400.\015\012<p>Message: Bad Request.\015\012</body>\015\012' Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> '' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:0> 'POST /Test/result HTTP/1.0\015\012Referer: http://www.rcp.co.uk:9080/Test/Post\015\012Connection: Keep- Alive\015\012User-Agent: Mozilla/4.61 [en] (WinNT; I)\015\012Host: www.rcp.co.uk:9080\015\012Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\015\012Accept-Encoding: gzip\015\012Accept-Language: en\015\012Accept-Charset: iso- 8859-1,*,utf-8\015\012Authorization: Basic ********************\015\012Cookie: SITESERVER=ID=97bdddbc2a4167ada362fe751304c5a4; RMID=c29a124837947b70; dtpref_rows="25"; dtpref_cols="85"; tree-s="eJyLjlZ3hANPW/XYWAAtiQTP"\015\012' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:0> 'Content-type: application/x-www-form-urlencoded\015\012Content- length: 9\015\012\015\012value=123\015\012' Send <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:1> 'HTTP/1.0 200 OK\015\012Server: Zope/(unreleased version) ZServer/1.1b1\015\012Date: Tue, 17 Aug 1999 09:20:22 GMT\015\012Connection: close\015\012Content-Type: text/html\015\012Content-Length: 64\015\012\015\012<HTML>\012<HEAD>\012result\012</HEAD>\01 2<BODY>\012Value is 123\012</BODY>\012</HTML>' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:1> ''
On Tue, 17 Aug 1999, Duncan Booth wrote:
On Fri, 13 Aug 1999, Duncan Booth wrote:
The problem seems to be with the Netscape Proxy server interpreting the result from Zope as any side-effects on the Zope server do happen.
I put some debug logging into medusa to dump everything sent or received by Zope. Now I can see exactly what the difference is between using the proxy server and going direct, and it looks to me like a problem with Zope, but I don't know for sure and would appreciate some advice. Well, it seems like the proxy is cutting of the value=123 content.
And ZOPE is complaining, that the proxy request doesn't contain the declared data. Andreas
Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:0> 'POST /Test/result HTTP/1.0\015\012Referer: http://dales.rmplc.co.uk:9080/Test/Post\015\012User-Agent: Mozilla/4.61 [en] (WinNT; I)\015\012Host: dales.rmplc.co.uk:9080\015\012Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\015\012Accept-Encoding: gzip\015\012Accept-Language: en\015\012Accept-Charset: iso- 8859-1,*,utf-8\015\012Cookie: SITESERVER=ID=97bdddbc2a4167ada362fe751304c5a4; RMID=c29a124837947b70\015\012Content-type: application/x-www- form-urlencoded\015\012Content-length: 9\015\012Forwarded: by http://duraluminium.rcp.co.uk:8080 (Netscape- Proxy/3.5)\015\012\015\012' Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> 'value=123\015\012\015\012\000' Send <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> 'HTTP/None 400 Bad Request\015\012Server: Medusa/1.10\015\012Content-Type: text/html\015\012Content- Length: 136\015\012Date: Tue, 17 Aug 1999 09:20:19 GMT\015\012\015\012<head>\015\012<title>Error response</title>\015\012</head>\015\012<body>\015\012<h1>Error response</h1>\015\012<p>Error code 400.\015\012<p>Message: Bad Request.\015\012</body>\015\012' Recv <zhttp_channel connected 194.154.18.78:3450 at c59230 channel#: 2 requests:1> '' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:0> 'POST /Test/result HTTP/1.0\015\012Referer: http://www.rcp.co.uk:9080/Test/Post\015\012Connection: Keep- Alive\015\012User-Agent: Mozilla/4.61 [en] (WinNT; I)\015\012Host: www.rcp.co.uk:9080\015\012Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\015\012Accept-Encoding: gzip\015\012Accept-Language: en\015\012Accept-Charset: iso- 8859-1,*,utf-8\015\012Authorization: Basic ********************\015\012Cookie: SITESERVER=ID=97bdddbc2a4167ada362fe751304c5a4; RMID=c29a124837947b70; dtpref_rows="25"; dtpref_cols="85"; tree-s="eJyLjlZ3hANPW/XYWAAtiQTP"\015\012' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:0> 'Content-type: application/x-www-form-urlencoded\015\012Content- length: 9\015\012\015\012value=123\015\012' Send <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:1> 'HTTP/1.0 200 OK\015\012Server: Zope/(unreleased version) ZServer/1.1b1\015\012Date: Tue, 17 Aug 1999 09:20:22 GMT\015\012Connection: close\015\012Content-Type: text/html\015\012Content-Length: 64\015\012\015\012<HTML>\012<HEAD>\012result\012</HEAD>\01 2<BODY>\012Value is 123\012</BODY>\012</HTML>' Recv <zhttp_channel connected 194.154.28.249:2565 at c5ae60 channel#: 3 requests:1> '' -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
Well, it seems like the proxy is cutting of the value=123 content.
And ZOPE is complaining, that the proxy request doesn't contain the declared data.
Andreas
Close, but it is actually that the proxy is appending \r\n\0 to the data, and Zope is getting confused.
'value=123\015\012\015\012\000'
A bit more investigation, and what I think is happening is that Zope receives and processes the request, then it finds the extra '\000' on the end of the data and tries to process that as another request. Not surprisingly this fails, (a tuple unpack throws an exception) but all of the side effects from the original request have been committed as though the request had succeeded. -- Duncan Booth duncan@dales.rmplc.co.uk int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3" "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure? http://dales.rmplc.co.uk/Duncan
On Tue, 17 Aug 1999, Duncan Booth wrote:
Well, it seems like the proxy is cutting of the value=123 content.
And ZOPE is complaining, that the proxy request doesn't contain the declared data.
Andreas
Close, but it is actually that the proxy is appending \r\n\0 to the data, and Zope is getting confused. Sorry, it's not easy to read wordwrapped python strings that lengthy :(
'value=123\015\012\015\012\000'
A bit more investigation, and what I think is happening is that Zope receives and processes the request, then it finds the extra '\000' on the end of the data and tries to process that as another request. Not surprisingly this fails, (a tuple unpack throws an exception) but all of the side effects from the original request have been committed as though the request had succeeded. Well, this sounds like a bug in the proxy, but one, that could be probably worked around in ZOPE, right?
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
participants (2)
-
Andreas Kostyrka -
Duncan Booth