javascript and iframe url's are now rewritten

This commit is contained in:
JT Smith 2003-03-19 03:56:50 +00:00
parent c62489fe46
commit 4df1f25fea
2 changed files with 4 additions and 3 deletions

View file

@ -164,6 +164,7 @@ sub www_view {
} }
$header = new HTTP::Headers; $header = new HTTP::Headers;
$header->referer($_[0]->get("proxiedURL")); # To get around referrer blocking
if($session{env}{REQUEST_METHOD}=~/GET/i if($session{env}{REQUEST_METHOD}=~/GET/i
|| $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're || $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're

View file

@ -20,7 +20,6 @@ use vars qw(@ISA);
@ISA = qw(HTML::Parser); @ISA = qw(HTML::Parser);
my %linkElements = # from HTML::Element.pm my %linkElements = # from HTML::Element.pm
( (
body => 'background', body => 'background',
@ -33,6 +32,8 @@ my %linkElements = # from HTML::Element.pm
frame => 'src', frame => 'src',
applet => 'codebase', applet => 'codebase',
area => 'href', area => 'href',
script => 'src',
iframe => 'src',
); );
my %tag_attr; my %tag_attr;
@ -91,7 +92,6 @@ sub end {
$_[0]->output("</$_[1]>") $_[0]->output("</$_[1]>")
} }
sub start { sub start {
my $self = shift; my $self = shift;
my ($tag, $attr, $attrseq, $origtext) = @_; my ($tag, $attr, $attrseq, $origtext) = @_;
@ -114,7 +114,7 @@ sub start {
$val = URI::URL::url($val)->abs($self->{Url},1); # make absolute $val = URI::URL::url($val)->abs($self->{Url},1); # make absolute
} }
if ($val->scheme eq "http") { 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 if (lc($tag) eq "form" && lc($_) eq "action") { # Found FORM ACTION
$self->{FormActionIsDefined}=1; $self->{FormActionIsDefined}=1;
$self->{FormAction} = $val; # set FormAction to include hidden field later $self->{FormAction} = $val; # set FormAction to include hidden field later