From 4df1f25feaab53b24bb93029f1f414ecabbdb08d Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 19 Mar 2003 03:56:50 +0000 Subject: [PATCH] javascript and iframe url's are now rewritten --- lib/WebGUI/Wobject/HttpProxy.pm | 1 + lib/WebGUI/Wobject/HttpProxy/Parse.pm | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Wobject/HttpProxy.pm b/lib/WebGUI/Wobject/HttpProxy.pm index 991c10c73..95e2a4610 100644 --- a/lib/WebGUI/Wobject/HttpProxy.pm +++ b/lib/WebGUI/Wobject/HttpProxy.pm @@ -164,6 +164,7 @@ sub www_view { } $header = new HTTP::Headers; + $header->referer($_[0]->get("proxiedURL")); # To get around referrer blocking if($session{env}{REQUEST_METHOD}=~/GET/i || $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're diff --git a/lib/WebGUI/Wobject/HttpProxy/Parse.pm b/lib/WebGUI/Wobject/HttpProxy/Parse.pm index 9b7c7d83e..c068b6a1f 100644 --- a/lib/WebGUI/Wobject/HttpProxy/Parse.pm +++ b/lib/WebGUI/Wobject/HttpProxy/Parse.pm @@ -19,7 +19,6 @@ use WebGUI::URL; use vars qw(@ISA); @ISA = qw(HTML::Parser); - my %linkElements = # from HTML::Element.pm ( @@ -33,6 +32,8 @@ my %linkElements = # from HTML::Element.pm frame => 'src', applet => 'codebase', area => 'href', + script => 'src', + iframe => 'src', ); my %tag_attr; @@ -91,7 +92,6 @@ sub end { $_[0]->output("") } - sub start { my $self = shift; my ($tag, $attr, $attrseq, $origtext) = @_; @@ -114,7 +114,7 @@ sub start { $val = URI::URL::url($val)->abs($self->{Url},1); # make absolute } if ($val->scheme eq "http") { - if (lc($tag) ne "img") { # no rewrite for images + if (lc($tag) ne "img" && lc($tag) ne "script" && lc($tag) ne "iframe") { # no rewrite for some if (lc($tag) eq "form" && lc($_) eq "action") { # Found FORM ACTION $self->{FormActionIsDefined}=1; $self->{FormAction} = $val; # set FormAction to include hidden field later