In some situations it may be desirable to completely hide User-Agent field when fetching a file e.g., when using over Tor. How-To-Repeat: $ sudo nc -kl 0 80 & # before $ HTTP_USER_AGENT= fetch http://0 GET / HTTP/1.1 Host: 0 Accept: */* User-Agent: fetch libfetch/2.0 Connection: close ^C # after $ HTTP_USER_AGENT= fetch http://0 GET / HTTP/1.1 Host: 0 Accept: */* Connection: close ^C # other download tools $ curl -A "" http://0 GET / HTTP/1.1 Host: 0 Accept: */* ^C $ wget -U "" http://0 2>/dev/null GET / HTTP/1.1 Accept: */* Host: 0 Connection: Keep-Alive ^C
A commit references this bug: Author: des Date: Thu Jun 5 20:27:17 UTC 2014 New revision: 267127 URL: http://svnweb.freebsd.org/changeset/base/267127 Log: If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all. PR: 184507 Submitted by: jbeich@tormail.org (with modifications) MFC after: 1 week Changes: head/lib/libfetch/fetch.3 head/lib/libfetch/http.c
Fixed on 2014-08-24 in r270460 (stable/10) and r270461 (stable/9)