bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] URL rewriting when resource name is in a variable


From: Tim Ruehsen
Subject: Re: [Bug-wget] URL rewriting when resource name is in a variable
Date: Wed, 19 Aug 2015 11:11:33 +0200
User-agent: KMail/4.14.2 (Linux/4.1.0-1-amd64; KDE/4.14.2; x86_64; ; )

Ok, that is a parser bug.

The parser should not parse (and thus not translate) anything between <script> 
and </script>

Could you please open an new issue on the bug tracker with the description 
below ? https://savannah.gnu.org/projects/wget/

Thank you.

Tim

On Tuesday 18 August 2015 09:50:10 Murali Ramanujam wrote:
> Hi
> 
> Sorry for the initial confusion.
> I have the following script tag in the original web page.
> 
> <script>
> var loc = "script.js";
> document.write("<script src=" + loc + "><\/script>");
> </script>
> 
> When I save it using wget -k -p, the corresponding saved file has the
> following script tag
> 
> <script>
> var loc = "script.js";
> document.write("<script src="http://localhost/+&#32;loc&#32;+";><\/script>");
> </script>
> 
> 
> The script tag written by document.write is expected to be “script.js” but
> wget saves it as “http://localhost/+loc+”
> Wget is trying to rewrite the link for scripts written by document.write
> which is not supposed to happen.
> 
> Thanks
> Regards,
> Murali
> 
> On Mon, Aug 17, 2015 at 10:16 PM, Ander Juaristi <address@hidden> wrote:
> > On 08/17/2015 05:04 AM, Murali Ramanujam wrote:
> >> Hi
> >> 
> >> 
> >> When I try to save the attached HTML page (original.html) with  wget -k
> >> -p, the resource path gets mangled in the rewrite process (saved.html is
> >> output of wget).
> > 
> > If I understood you well, you execute
> > 
> >     wget -k -p http://localhost/original.html
> > 
> > and get a file called 'saved.html' as a result?!
> > 
> > What do you mean with "resource name is in a variable"? What's the exact
> > command you executed on the console?
> > 
> >> The saved page gives a SyntaxError error when opened. In addition, it
> >> looks like wget is trying to rewrite the src to http://localhost/loc but
> >> it should be http://localhost/script.js.
> >> 
> >> 
> >> Script.js is just console.log(1);
> >> 
> >> 
> >> Is this a valid bug? Is there any way to get expected behaviour from wget
> >> in such a situation?
> > 
> > Could you pass the flag '--debug' and post the output?
> > 
> >> Thanks
> >> Murali
> > 
> > Regards,
> > - AJ

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]