cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [Patch] Avoid sending the URL fragment

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 3 Jan 2010 23:05:27 +0100 (CET)

On Sun, 3 Jan 2010, Claes Jakobsson wrote:

> + /* Remove the fragment part of the path. Per RFC 2396, this is always the
> + last part of the URI. */
> + fragment = strrchr(path, '#');
> + if(fragment)
> + *fragment = 0;
>
> Altho the specification forbids any # in the fragment part I think it's
> better to look for the leftmost # and consider everything after that the
> fragment. That way "http://foo/#bar#baz" won't cause any problems.

Yes, I agree. 'path' in this context is only the path fragment of the URI/URL
anyway so doing a strchr() for '#' should be a better idea I think.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-03