Why modern curl versions cut off the #anchor part of the URL?

Viewed 429

I have observed a curious behaviour between different curl versions.

In CentOS 6 with curl 7.19.7 if I do curl 'localhost:9999/foo#bar' (nc listening on 9999) I get:

GET /foo#bar HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Host: localhost:9999
Accept: */*

but if I do the same curl on a modern system (Debian 8) with curl 7.38.0 I get:

GET /foo HTTP/1.1
User-Agent: curl/7.38.0
Host: localhost:9999
Accept: */*

Note the URL is different: /foo#bar (7.19.7) versus /foo (7.38.0)

I understand that the right behaviour is removing the #anchor part, given is the one the newer version of curl implements. However, I don't understand the reason of that change... Any hint about such reason or a reference to look (e.g. RFC) for it, please?

I have tried to find information in the curl changelog but it is too verbose and I haven't found the change and/or rationale behind it.

2 Answers
Related