
| Key: |
HTTPCLIENT-600
|
| Type: |
Improvement
|
| Status: |
Closed
|
| Resolution: |
Invalid
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Denis Valdenaire
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
15/Sep/06 01:16 PM
|
|
I discovered that the method
addContentLengthRequestHeader (found in file methods/MultipartPostMethod.java) doesn't "fix" the content-lenght when this one is incorrect. It adds one if getRequestHeader("Content-Lenght") is null, but it should also verify that the content-lenght is correct.
I suggest something like :
long len = getRequestContentLength();
if (getRequestHeader("Content-Length") == null || getRequestHeader("Content-Length") != len) {
setRequestHeader("Content-Length", String.valueOf(len));
}
Sending an incorrect Content-Length blocks the server if the string sent is smaller than announced : waiting for more, and finally reset the connection. If it's too big, you lose data.
I've seen this problem in a reverse proxy program (with httpclient communicating with the real servers) when the client send urlencoded data and this data is modified (partly urldecoded) but not the content-lenght.
|
|
Description
|
I discovered that the method
addContentLengthRequestHeader (found in file methods/MultipartPostMethod.java) doesn't "fix" the content-lenght when this one is incorrect. It adds one if getRequestHeader("Content-Lenght") is null, but it should also verify that the content-lenght is correct.
I suggest something like :
long len = getRequestContentLength();
if (getRequestHeader("Content-Length") == null || getRequestHeader("Content-Length") != len) {
setRequestHeader("Content-Length", String.valueOf(len));
}
Sending an incorrect Content-Length blocks the server if the string sent is smaller than announced : waiting for more, and finally reset the connection. If it's too big, you lose data.
I've seen this problem in a reverse proxy program (with httpclient communicating with the real servers) when the client send urlencoded data and this data is modified (partly urldecoded) but not the content-lenght.
|
Show » |
made changes - 15/Sep/06 01:16 PM
| Field |
Original Value |
New Value |
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Resolution
|
|
Invalid
[ 6
]
|
Roland Weber made changes - 22/Apr/07 07:11 AM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|