Bug 693026

Summary: wget rewrites URL in form action to point to a local file
Product: [Fedora] Fedora Reporter: Igor Slepchin <igor>
Component: wgetAssignee: Karsten Hopp <karsten>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: karsten, micah
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 903424 (view as bug list) Environment:
Last Closed: 2012-08-16 13:43:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Igor Slepchin 2011-04-02 04:01:43 UTC
Description of problem:

If the URL in the form "action" is the same as the URL of the web page containing the form, wget assumes it has already downloaded the file at that URL and rewrites the URL in form action to point to the local file, which is obviously not something one would expect. Instead, that URL should be converted to an absolute HTTP URL.

This happens because convert_links_in_hashtable() in convert.c knows that question.asp itself was downloaded and rewrites the action url to point to the local file.

Version-Release number of selected component (if applicable):


How reproducible:

Mine is 1.12.2 but I believe the same issue exists in just about all versions.

Steps to Reproduce:

$ echo "<form action="wget1.asp.html" method="post"/>" > wget.html
$ python -m SimpleHTTPServer

then try to download the file:
$ wget -P. -k http://localhost:8000/wget.asp.html

You'll see that the URL in the form's action gets converted:
$ cat wget.asp.html 
<form action="http://localhost:8000/wget1.asp.html" method="post"/>

Now, change that URL to be the same as the page name, e.g.,

$ echo "<form action="wget.asp.html" method="post"/>" > wget.html
$ python -m SimpleHTTPServer

and try downloading it again with the same wget command. You'll see that the URL is now rewritten to point to a local file:

$ wget -P. -k http://localhost:8000/wget.asp.html
$ $ cat wget.asp.html.1 
<form action="wget.asp.html.1" method="post"/>

Expected results:

The form action URL should be rewritten into an absolute URL consistently.

Additional info:

I've already submitted this upstream and attached a proposed patch there but it would be nice to get this fixed in Fedora as there hasn't been much response there: http://savannah.gnu.org/bugs/?32587

Comment 1 Fedora End Of Life 2012-08-16 13:43:41 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping