diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-04-17 09:51:19 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-04-17 09:51:19 +0000 |
commit | 444b2959e99bb28136447bef5070190877cc3322 (patch) | |
tree | b278f4b163c4d49752265ba4445f4d5db6848da3 | |
parent | 1af602ed16eb5f03980642d7ae0fed6e3fc12b12 (diff) |
ftp: send 'Accept */*' header
A recent update to filezilla showed a server that would refuse to let us
download the distfile without us sending this header. Browsers, curl and
wget do so, so it should be safe for us to follow suit.
ok deraadt florian phessler sthen
-rw-r--r-- | usr.bin/ftp/fetch.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 02911b5342a..55b6a9feafe 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.216 2023/06/28 17:35:06 op Exp $ */ +/* $OpenBSD: fetch.c,v 1.217 2024/04/17 09:51:18 tb Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -705,7 +705,8 @@ noslash: */ ftp_printf(fin, "GET %s HTTP/1.1\r\n" "Connection: close\r\n" - "Host: %s\r\n%s%s\r\n", + "Host: %s\r\n%s%s\r\n" + "Accept: */*\r\n", epath, proxyhost, buf ? buf : "", httpuseragent); if (credentials) ftp_printf(fin, "Authorization: Basic %s\r\n", @@ -773,8 +774,8 @@ noslash: ftp_printf(fin, "\r\nIf-Modified-Since: %s", tmbuf); #endif /* SMALL */ - ftp_printf(fin, "\r\n%s%s\r\n", - buf ? buf : "", httpuseragent); + ftp_printf(fin, "\r\n%s%s\r\n", buf ? buf : "", httpuseragent); + ftp_printf(fin, "Accept: */*\r\n"); if (credentials) ftp_printf(fin, "Authorization: Basic %s\r\n", credentials); |