#1158 HTTP GET through proxy passes '#anchor' part of the URL

closed-fixed
http (206)
5
2014-08-28
2012-10-24
geronime
No

Hello,

see following curl commands and netcat outputs of done requests (first without proxy, second one with localhost privoxy) - with proxy the '#anchor' part of the URL is passed through but without the proxy it is not. I am unsure about what the correct behaviour should be, but e.g. wget behaves the same with and without proxy.

$ curl -v -s -XGET 'http://127.0.0.1:10000/path?param=val#anchor'
* About to connect() to 127.0.0.1 port 10000 (#0)
* Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 10000 (#0)
> GET /path?param=val HTTP/1.1
> User-Agent: curl/7.28.0
> Host: 127.0.0.1:10000
> Accept: */*
>@
^C

$ netcat -lp 10000
GET /path?param=val HTTP/1.1
User-Agent: curl/7.28.0
Host: 127.0.0.1:10000
Accept: */*

---

$ curl -v -s --proxy http://127.0.0.1:8080 -XGET 'http://127.0.0.1:10000/path?param=val#anchor'
* About to connect() to proxy 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET http://127.0.0.1:10000/path?param=val#anchor HTTP/1.1
> User-Agent: curl/7.28.0
> Host: 127.0.0.1:10000
> Accept: */*
> Proxy-Connection: Keep-Alive
>@
^C

$ netcat -lp 10000
GET /path?param=val#anchor HTTP/1.1
User-Agent: curl/7.28.0
Host: 127.0.0.1:10000
Accept: */*

---

$ wget -qO - 'http://127.0.0.1:10000/path?param=val#anchor'
^C

$ netcat -lp 10000
GET /path?param=val HTTP/1.1
User-Agent: Wget/ (linux-gnu)
Accept: */*
Host: 127.0.0.1:10000
Connection: Keep-Alive

---

$ wget --proxy http://127.0.0.1:8080 -qO - 'http://127.0.0.1:10000/path?param=val#anchor'
^C

$ netcat -lp 10000
GET /path?param=val HTTP/1.1
User-Agent: Wget/ (linux-gnu)
Accept: */*
Host: 127.0.0.1:10000
Connection: Keep-Alive

I have latest curl from gentoo tree.
$ curl -V
curl 7.28.0 (x86_64-pc-linux-gnu) libcurl/7.28.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IDN Largefile NTLM NTLM_WB SSL libz TLS-SRP

Regards

Jiri

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2012-11-06
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks