Bug 903424 - wget rewrites URL in form action to point to a local file
Summary: wget rewrites URL in form action to point to a local file
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: wget
Version: 18
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Tomáš Hozza
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-24 00:10 UTC by igor.redhat@gmail.com
Modified: 2013-04-25 09:02 UTC (History)
4 users (show)

Fixed In Version:
Clone Of: 693026
Environment:
Last Closed: 2013-04-25 09:02:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description igor.redhat@gmail.com 2013-01-24 00:10:56 UTC
+++ This bug was initially created as a clone of Bug #693026 +++

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

--- Additional comment from Fedora End Of Life on 2012-08-16 09:43:41 EDT ---

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

Comment 1 Tomáš Hozza 2013-01-24 09:52:53 UTC
(In reply to comment #0)
> 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

There will be *NO* "wget.asp.html" since you've created "wget.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"/>

Please correct your steps to reproduce. There are some errors and I'm not able to reproduce your issue. Then try your steps on the *CURRENT VERSION* of wget in Fedora 18.

> Expected results:
> 
> The form action URL should be rewritten into an absolute URL consistently.

From how I understand what you are describing, this is normal behaviour when
using the "-k" wget option.
 
> 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

Since this would be a change in behaviour, I not going to apply patch in Fedora before Upstream accepts it.

Comment 2 Tomáš Hozza 2013-04-25 09:02:50 UTC
Due to lack of response and information I'm closing this Bug as INSUFFICIENT_DATA.


Note You need to log in before you can comment on or make changes to this bug.