'If-Modified-Since' handled incorrectly
Daniel Buenzli (buenzli@rzu.unizh.ch)
Wed, 4 Mar 1998 08:36:18 +0100 (MET)
In LWP::Protocol::http::request, version 1.39 (12 Feb 98), response
headers are processed by reading the first line (including '\015?\012')
followed by all subsequent lines, until '\015?\012\015?\012' is found.
However, some servers just return 'HTTP/1.1 304 Not Modified\r\n\r\n'
on a 'If-Modified-Since' request, resulting in an error message
'500 unexpected EOF before all headers seen' generated by the subroutine,
since '\015?\012\015?\012' is never found (earlier versions terminated
the loop quietly by a 'last' and returned the correct error message,
however, version 1.39 dies on the spot).
The bug can be easiliy fixed by the following patch:
178c178
< while ($buf !~ /\015?\012\015?\012/) {
---
> while ($buf !~ /(?:\015?\012|^)\015?\012/) {
__________________________________________________________________________
Daniel Buenzli
University of Zurich, Computing Center e-mail: buenzli@rzu.unizh.ch
Winterthurerstrasse 190 Phone: +41 1 635 6772
CH-8057 Zuerich FAX: +41 1 635 4505