cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] http: print reason phrase from HTTP status line on error

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Sat, 21 Jul 2012 16:38:26 +0200

On Saturday, July 21, 2012 12:51:10 Fabian Keil wrote:
> Maybe there should be a:
>
> if(!end)
> end = strchr(start, '\n');
>
> here, to deal with the minority of servers that terminate
> headers with a single LF. It would be consistent with other
> parts of libcurl, for example copy_header_value().

Thank you for looking at the patch! I am not convinced that we should be
trying to get the reason phrase from a non-compliant HTTP server. In that
case, fallback to printing just the status code feels like fair response
to me. Otherwise we could end up printing non-printable characters to the
error buffer.

Are you aware of any publicly available HTTTP server that would exercise
the code path above? This would need some testing I guess...

Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-21