Re: [PATCH] Fix case sensitivity when searching for headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This is a patch making the search for the Location header on a 30X HTTP  
> response case insensitive, rather then case sensitive. I couldn't find  
> where the RFCs mandate the header should be capitalized, and sometimes  
> it isn't.

According to RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2):

   Field names are case-insensitive.

> >From 8dfd0bb43a76f8624fab360a47ae2d47796552ad Mon Sep 17 00:00:00 2001
> From: Jeroen van Meeuwen (Fedora Unity) <kanarip@xxxxxxxxxxxxxxx>
> Date: Tue, 30 Dec 2008 02:44:41 +0100
> Subject: [PATCH] Fix case sensitivity when searching for headers
> 
> ---
>  loader/ftp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/loader/ftp.c b/loader/ftp.c
> index e84237c..aa7a95b 100644
> --- a/loader/ftp.c
> +++ b/loader/ftp.c
> @@ -645,7 +645,7 @@ static char *find_header (char *headers, char *to_find)
>      if (asprintf(&searching_for, "\r\n%s:", to_find) == -1)
>          return NULL;
>  
> -    if ((start = strstr(headers, searching_for)) == NULL) {
> +    if ((start = strcasestr(headers, searching_for)) == NULL) {
>          free(searching_for);    
>          return NULL;
>      }

This looks good to me.  I'll apply here in a few minutes when I get done
with the next round of packing boxes and hauling out trash.  Thanks for
the patch.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux