Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix typo

  • Loading branch information...
commit 047987afafde3ec53fa141718d09d6ec92f20697 1 parent d2ca2e0
Ryo Anazawa authored
Showing with 21 additions and 21 deletions.
  1. +21 −21 lib/CGI/Header.pm
View
42 lib/CGI/Header.pm
@@ -219,13 +219,6 @@ sub _normalize {
$is_ignored{ $norm } ? undef : $norm;
}
-sub clone {
- my $self = shift;
- my $class = ref $self or croak "Can't clone non-object: $self";
- my $header = $header{ refaddr $self };
- $class->new( %{ $header } );
-}
-
sub is_empty { !shift->SCALAR }
sub clear {
@@ -235,6 +228,13 @@ sub clear {
return;
}
+sub clone {
+ my $self = shift;
+ my $class = ref $self or croak "Can't clone non-object: $self";
+ my $header = $header{ refaddr $self };
+ $class->new( %{$header} );
+}
+
BEGIN {
my %conflict_with = (
attachment => '-content_disposition',
@@ -278,29 +278,29 @@ sub p3p_tags {
}
sub field_names {
- my $self = shift;
- my $header = $header{ refaddr $self };
- my %headers = %{ $header }; # copy
+ my $self = shift;
+ my $header = $header{ refaddr $self };
+ my %copy = %{ $header };
my @fields;
- push @fields, 'Server' if my $nph = delete $headers{-nph};
+ push @fields, 'Server' if my $nph = delete $copy{-nph};
- push @fields, 'Status' if delete $headers{-status};
- push @fields, 'Window-Target' if delete $headers{-target};
- push @fields, 'P3P' if delete $headers{-p3p};
+ push @fields, 'Status' if delete $copy{-status};
+ push @fields, 'Window-Target' if delete $copy{-target};
+ push @fields, 'P3P' if delete $copy{-p3p};
- push @fields, 'Set-Cookie' if my $cookie = delete $headers{-cookie};
- push @fields, 'Expires' if my $expires = delete $headers{-expires};
+ push @fields, 'Set-Cookie' if my $cookie = delete $copy{-cookie};
+ push @fields, 'Expires' if my $expires = delete $copy{-expires};
push @fields, 'Date' if $nph or $cookie or $expires;
- push @fields, 'Content-Disposition' if delete $headers{-attachment};
+ push @fields, 'Content-Disposition' if delete $copy{-attachment};
- my $type = delete @headers{qw/-charset -type/};
+ my $type = delete @copy{qw/-charset -type/};
# not ordered
- for my $norm ( keys %headers ) {
- next unless defined $headers{ $norm };
+ while ( my ($norm, $value) = CORE::each %copy ) {
+ next unless defined $value;
push @fields, do {
my $field = $norm;
@@ -592,7 +592,7 @@ this module removes them instead of throwing exceptions.
=item $header->attachment( $filename )
-Can be used to turn tha page into an attachment.
+Can be used to turn the page into an attachment.
Represents suggested name for the saved file.
$header->attachment( 'genome.jpg' );
Please sign in to comment.
Something went wrong with that request. Please try again.