#626992 -c scans binary files as if they were html, after receiving 416 response

Package:
wget
Source:
wget
Description:
retrieves files from the web
Submitter:
Jim Paris
Date:
2011-07-24 05:27:19 UTC
Severity:
normal
#626992#5
Date:
2011-05-16 21:36:50 UTC
From:
To:
Hi,

While using "wget -c -r" on a directory of large binary files, I
noticed long delays after the "The file is already fully retrieved;
nothing to do." message.

It turns out this is because the server returned a 416 response with
Content-Type: text/html, and so Wget decides to scan the file for
links, as if it were HTML.  But the file is not HTML -- just the 416
response body was.

Example:

$ cd /tmp
$ wget -c -d -r http://www.gnu.org/graphics/t-desktop-4-small.jpg

(The file is downloaded as expected, and not scanned for URLs)

$ wget -c -d -r http://www.gnu.org/graphics/t-desktop-4-small.jpg

(This time, notice in the debug output how the file was "Loaded" and
scanned for "no-follow" links.  This is the source of the delay on
large binary files).

#626992#10
Date:
2011-07-23 10:17:57 UTC
From:
To:
tags 626992 + upstream
forwarded 626992 https://savannah.gnu.org/bugs/index.php?33833
thanks

Am Montag, den 16.05.2011, 17:36 -0400 schrieb Jim Paris:
...
Thank you for your report. I forwarded it to the upstream developer.

#626992#19
Date:
2011-07-23 10:16:28 UTC
From:
To:
URL:
  <http://savannah.gnu.org/bugs/?33833>

                 Summary: -c scans binary files as if they were html, after
receiving 416 response
                 Project: GNU Wget
            Submitted by: nok
            Submitted on: Sa 23 Jul 2011 12:16:28 CEST
                Category: Program Logic
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.12
        Operating System: GNU/Linux
         Reproducibility: None
           Fixed Release: None
         Planned Release: None
              Regression: None
           Work Required: None
          Patch Included: None