I have a system which is accepting Base 64 encoded data from an external source, due to the protocol being used at the other end this is being passed in through a URL variable. e.g. http://foo.bar.com?Data=uiDggGREJJytIIUicSSAa+WEhnGK I am having an issue (Using Zope 2.7.6, Python 2.3.5) where the + and / characters in the incoming data are being replaced with spaces. Unfortunately, since both + and / are being replaced with the same character, it is not simply a matter of doing a find and replace on the string to restore these characters. This system did work fine for a long while. I upgraded the machine's Python from 2.3.5 to 2.4.1 a couple of months ago and have now reverted back to 2.3.5. Has anyone encountered a similar problem before and how can I work around/through it? Kindest regards Jonathan Cleaver
--On 6. Februar 2006 08:33:47 +0000 Jonathan Cleaver <jcleaver.hq@da.mod.uk> wrote:
I have a system which is accepting Base 64 encoded data from an external source, due to the protocol being used at the other end this is being passed in through a URL variable.
Such data should be passed to Zope as POST request, not through GET. -aj
Thanks for your reply. Unfortunately, the protocol that I am working with means that my script is receiving an HTTP GET, not a POST. Is there a way I can sensibly 'tweak' the request coming in to circumvent this? I have reason to believe that there is considerable inertia at the other end to changing their method. Kindest regards Jonathan Andreas Jung wrote:
--On 6. Februar 2006 08:33:47 +0000 Jonathan Cleaver <jcleaver.hq@da.mod.uk> wrote:
I have a system which is accepting Base 64 encoded data from an external source, due to the protocol being used at the other end this is being passed in through a URL variable.
Such data should be passed to Zope as POST request, not through GET.
-aj
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
--On 6. Februar 2006 09:23:10 +0000 Jonathan Cleaver <jcleaver.hq@da.mod.uk> wrote:
Thanks for your reply.
Unfortunately, the protocol that I am working with means that my script is receiving an HTTP GET, not a POST. Is there a way I can sensibly 'tweak' the request coming in to circumvent this? I have reason to believe that there is considerable inertia at the other end to changing their method.
Then you should follow Jens' advise to encode the stuff properly on the sender side...but we warned: there is (configurable) restriction of the maximum HTTP header length of 8K. Do try to send mass data through a GET request. -aj
Many thanks for your replies, Andreas and Jens, most helpful. [Rolls up sleeves...] Andreas Jung wrote:
--On 6. Februar 2006 09:23:10 +0000 Jonathan Cleaver <jcleaver.hq@da.mod.uk> wrote:
Thanks for your reply.
Unfortunately, the protocol that I am working with means that my script is receiving an HTTP GET, not a POST. Is there a way I can sensibly 'tweak' the request coming in to circumvent this? I have reason to believe that there is considerable inertia at the other end to changing their method.
Then you should follow Jens' advise to encode the stuff properly on the sender side...but we warned: there is (configurable) restriction of the maximum HTTP header length of 8K. Do try to send mass data through a GET request.
-aj
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On 6 Feb 2006, at 08:33, Jonathan Cleaver wrote:
I have a system which is accepting Base 64 encoded data from an external source, due to the protocol being used at the other end this is being passed in through a URL variable.
e.g. http://foo.bar.com?Data=uiDggGREJJytIIUicSSAa+WEhnGK
I am having an issue (Using Zope 2.7.6, Python 2.3.5) where the + and / characters in the incoming data are being replaced with spaces. Unfortunately, since both + and / are being replaced with the same character, it is not simply a matter of doing a find and replace on the string to restore these characters.
This system did work fine for a long while. I upgraded the machine's Python from 2.3.5 to 2.4.1 a couple of months ago and have now reverted back to 2.3.5.
Has anyone encountered a similar problem before and how can I work around/through it?
Just base64-encoding and then attempting to pass that in a URL is not safe. The right approach would be to base64-encode and then urlencode before adding it into the URL. jens
participants (3)
-
Andreas Jung -
Jens Vagelpohl -
Jonathan Cleaver