[Patch] FPHTTPClient.IndexOfHeader may give wrong value
Original Reporter info from Mantis: engkin @engkin
-
Reporter name:
Original Reporter info from Mantis: engkin @engkin
- Reporter name:
Description:
IndexOfHeader compares the header in the parameter with a part of similar length of the stored headers which, if the beginning of the stored header happen to equal the parameter, gives wrong result.
Steps to reproduce:
Add the following two headers like Accept and Accept-Language:
AddHeader('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8');
AddHeader('Accept-Language','en-US,en;q=0.5');
Now both IndexOfHeader('Accept') and IndexOfHeader('Accept-Language') return the same value pointing at Accept-Language header.
Additional information:
The included patch is just a simple proposal to fix this bug by adding a colon to the header in the parameter.
It also adds a space for the Cookies header, and replaces the value of an existing header with a new value. These two changes are not related to this bug.
Mantis conversion info:
- Mantis ID: 33680
- Fixed in version: 3.1.1
- Fixed in revision: 38910 (#a8e5d89a)
- Target version: 3.2.0