Problem with POST when compression (gzip) is used

Discussion in 'Apache' started by harshareddy75, Apr 7, 2010.

  1. #1
    Hi,

    I am using my application to POST to a server and get a response from it. The server I am using is based on Apache 2. Now I am trying to compress the data that has to be posted.

    So I changed the header from content-type text/xml to content-type application/gzip and it worked perfectly fine. But I also wanted to test what would happen if the server did not support decompression (as some of the servers I am dealing with might not support it).

    So after some searching I realized that deflate_module allows me to control the servers capabilities of handling compression. So I added this module and also added the following lines
    <Location /dav-area>
    SetInputFilter DEFLATE
    </Location>
    (http://httpd.apache.org/docs/2.0/mod/mod_deflate.html)

    Now according to the above page, I should send a Content-Encoding: gzip header to ensure that the server decompresses the data. But whenever I send this header (with out w/o the content-type header), I always get a status code of 500. Could anybody please tell me why this is the case and how to solve my problem?

    Thanks
    Harsha
     
    harshareddy75, Apr 7, 2010 IP
  2. esupportsnet

    esupportsnet Greenhorn

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Hello,

    I understood the settings that you have made. But I could not get the requirement and the error that you are getting.
     
    esupportsnet, Apr 8, 2010 IP
  3. harshareddy75

    harshareddy75 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I thought I had edited my post earlier but it seems there was some problem.

    Anyhow I was working on my problem a bit more and realised some of the mistakes that I was making but I am still stuck at a certain point.

    Content-type application/gzip does not work. So I sent Content-Encoding: gzip which resulted in a correct response. Till here everything was fine. (I posted something totally wrong in my 1st post. I apologize for that)

    Now I want to check how the server responds if it does not support gzip. So I deleted the lines
    <Location /dav-area>
    SetInputFilter DEFLATE
    </Location>
    and later the disabled the module_deflate itself, but still when I send the Content-Encoding: gzip header and the compressed data for POST, the server responds with the correct answer (which it should not as it should not have decompressed the data) and this is what I cant understand. Why is the server decompressing the data. I hope now you do understand my problem. I apologize again for the wrong post earlier.
     
    harshareddy75, Apr 8, 2010 IP