#1085205 wget fails to fetch files that redirect from a directory (workaround: use aria2c)

Package:
wget
Source:
wget
Description:
retrieves files from the web
Submitter:
Manny
Date:
2024-10-16 09:51:03 UTC
Severity:
normal
Tags:
#1085205#5
Date:
2024-10-16 09:50:22 UTC
From:
To:
Apparently when a URL refers to a directory that redirects to a file,
wget gives up instantly without checking the redirect header. This is
a sample broken session:

===8<------------------------------
$ wget 'https://consumer.georgia.gov/document/document/consumer-complaint-form-english/download'
--[timestamp]--  https://consumer.georgia.gov/document/document/consumer-complaint-form-english/download
Resolving consumer.georgia.gov (consumer.georgia.gov)... 104.18.74.48
Connecting to consumer.georgia.gov (consumer.georgia.gov)|104.18.74.48|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 183944 (180K) [application/pdf]
download: Is a directory
===8<------------------------------

** workaround **

The workaround is basically to use anything other than wget. Firefox
works but FF suggests the wrong filename. Aria2c works flawlessly and
sets the correct filename. This is what the aria2c session looks like:

===8<------------------------------
$ aria2c 'https://consumer.georgia.gov/document/document/consumer-complaint-form-english/download'
[timestamp] [NOTICE] Downloading 1 item(s)
[#6234b1 0B/0B CN:1 DL:0B]
[timestamp] [NOTICE] Download complete: $PWD/Consumer Complaint Form - 2024-09-30.pdf

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
6234b1|OK  |   459KiB/s|$PWD/Consumer Complaint Form - 2024-09-30.pdf

Status Legend:
(OK):download completed.
===8<------------------------------