Jakarta Commons HttpClient and a socket reset

Discussion in 'Java' started by Joe Linux, Sep 15, 2006.

  1. Joe Linux

    Joe Linux Guest

    Hi,

    This is not a question : this is a possible answer on a problem you may
    have.

    I you use httpclient and you set the content-length header incorrectly
    while you post an application/x-www-form-urlencoded form (it's the
    default), httpclient won't fix it for you - there are good reasons for
    this.

    In the case you post, say, 100 bytes
    (variable=value&variable2=value2&...) and set the content-length header
    to 101, the server will wait untill it reach a timetout for the 101st
    byte.

    It may seem obvious but in the case i saw, for a reverse proxy, a
    particuliar client post a value and urlencoded the dash "-" as %2d -
    The reverse proxy "silently" urldecoded this as "-", and so modified
    the length of the posted string without modifying the content-length
    which it forwarwed to the proxyied servers untouched. And these one
    blocked, waiting for 2 other bytes that never came.

    Hope this helps someone...

    Denis Valdenaire
     
    Joe Linux, Sep 15, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua
    Replies:
    0
    Views:
    584
    Joshua
    Oct 20, 2004
  2. Gamas
    Replies:
    0
    Views:
    2,330
    Gamas
    Feb 4, 2005
  3. Dundonald
    Replies:
    0
    Views:
    401
    Dundonald
    Mar 22, 2005
  4. Dundonald
    Replies:
    2
    Views:
    898
    Dundonald
    Mar 23, 2005
  5. Replies:
    2
    Views:
    2,161
Loading...

Share This Page