r33522 - in /trunk/libcgi-simple-perl: Changes META.yml README SIGNATURE debian/changelog lib/CGI/Simple.pm lib/CGI/Simple/Cookie.pm lib/CGI/Simple/Standard.pm lib/CGI/Simple/Util.pm t/020.cookie.t t/050.simple.t t/070.standard.t
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Sat Apr 18 17:06:17 UTC 2009
Author: ryan52-guest
Date: Sat Apr 18 17:06:12 2009
New Revision: 33522
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33522
Log:
New upstream release
Modified:
trunk/libcgi-simple-perl/Changes
trunk/libcgi-simple-perl/META.yml
trunk/libcgi-simple-perl/README
trunk/libcgi-simple-perl/SIGNATURE
trunk/libcgi-simple-perl/debian/changelog
trunk/libcgi-simple-perl/lib/CGI/Simple.pm
trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm
trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm
trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm
trunk/libcgi-simple-perl/t/020.cookie.t
trunk/libcgi-simple-perl/t/050.simple.t
trunk/libcgi-simple-perl/t/070.standard.t
Modified: trunk/libcgi-simple-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/Changes?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/Changes (original)
+++ trunk/libcgi-simple-perl/Changes Sat Apr 18 17:06:12 2009
@@ -158,3 +158,8 @@
1.108 2009-03-13
- Remove bogus references to Selfloader in documenation. No
functional changes.
+
+1.109 2009-04-16
+ - Added support for HttpOnly to CGI::Simple::Cookie. Thanks to
+ Scott Thomson for the patch.
+
Modified: trunk/libcgi-simple-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/META.yml?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/META.yml (original)
+++ trunk/libcgi-simple-perl/META.yml Sat Apr 18 17:06:12 2009
@@ -1,6 +1,6 @@
---
name: CGI-Simple
-version: 1.108
+version: 1.109
author:
- 'Andy Armstrong <andy at hexten.net>'
abstract: A Simple totally OO CGI interface that is CGI.pm compliant
@@ -12,16 +12,16 @@
provides:
CGI::Simple:
file: lib/CGI/Simple.pm
- version: 1.108
+ version: 1.109
CGI::Simple::Cookie:
file: lib/CGI/Simple/Cookie.pm
- version: 1.108
+ version: 1.109
CGI::Simple::Standard:
file: lib/CGI/Simple/Standard.pm
- version: 1.108
+ version: 1.109
CGI::Simple::Util:
file: lib/CGI/Simple/Util.pm
- version: 1.108
+ version: 1.109
generated_by: Module::Build version 0.32
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
Modified: trunk/libcgi-simple-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/README?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/README (original)
+++ trunk/libcgi-simple-perl/README Sat Apr 18 17:06:12 2009
@@ -1,4 +1,4 @@
-CGI-Simple version 1.108
+CGI-Simple version 1.109
INSTALLATION
Modified: trunk/libcgi-simple-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/SIGNATURE?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/SIGNATURE (original)
+++ trunk/libcgi-simple-perl/SIGNATURE Sat Apr 18 17:06:12 2009
@@ -15,22 +15,22 @@
Hash: SHA1
SHA1 706f0c6def0e7917bf4b94d52ea75af1a2cacee3 Build.PL
-SHA1 b40b3e6da48655a4bf411d3d95f361fe9314155b Changes
+SHA1 23a4c5b46b310b672fc0daf6d0d4b8017dde6445 Changes
SHA1 32baa58c4ee8a9f9b4b386ed1dc00a882eed3c39 MANIFEST
-SHA1 fa9259f6e68b7c1f1456f9fb914c63c81eb7a89e META.yml
+SHA1 34dae5c95d3a8d90ddb84415cc58e60fb1906673 META.yml
SHA1 a319c0eeaf2d35f87387cca92b851564bcb128d6 Makefile.PL
-SHA1 5d23f870211f2c2c4c86ee70d56f99d780a1d4f3 README
-SHA1 3b54b5e252d3c925619ea6fff490f27e9de6e3ad lib/CGI/Simple.pm
-SHA1 6b079d735405493c7ecf6c1273f3d285c5227534 lib/CGI/Simple/Cookie.pm
-SHA1 d8a066fc305ffd6517fa8beb43017f5d8bfa88ec lib/CGI/Simple/Standard.pm
-SHA1 c90f817f87b016952b1abbfc024c477caca05732 lib/CGI/Simple/Util.pm
+SHA1 8dc5d7f3d2970126df4839e710d8a2c42ff15624 README
+SHA1 63d8335cd8d43bd78baf3c06f10bbedfc13ad5df lib/CGI/Simple.pm
+SHA1 32e7f18dd31179dd42658d3f3b4d86f9e03baf5c lib/CGI/Simple/Cookie.pm
+SHA1 eb72530e20fab3342ed17879dafac91a9e2a6d15 lib/CGI/Simple/Standard.pm
+SHA1 3859cb704f560199570b2bf382072c4d2c908608 lib/CGI/Simple/Util.pm
SHA1 029a0c2274884058f99bc339fd5bb073348c2b77 t/000.load.t
-SHA1 2b2ff00999214136e5ac075c79bef7146fd4274b t/020.cookie.t
+SHA1 b02cd8953e5da31678711b93f4f8ebc2939e453a t/020.cookie.t
SHA1 ca2ff8ba2f9a5f68c75e8d9527af38b042067148 t/030.function.t
SHA1 e8fbebb9354bcd7755bfecaa564f44467265242c t/040.request.t
-SHA1 1b433740f6b5f7d282e2ecf659f2edaa70d003ea t/050.simple.t
+SHA1 c4cb337005177eec328117ad15ed86514e9cdb0d t/050.simple.t
SHA1 4d5dd87be1d9d13a0eadd45a448d3373a6092415 t/060.slow_post.t
-SHA1 ff403cdeb2019e9bad7752bc8db28fcdb8da37fd t/070.standard.t
+SHA1 04d5d7917dc9398866a05e660f0c729158d51830 t/070.standard.t
SHA1 4a7dade2334d9e4f5b223cbb6c9ebd49cb5cf4a3 t/080.util.t
SHA1 432c00d3873dd6c70998f18149ba7517ffb56602 t/090.14838.t
SHA1 73ac0f1550806696461a8c356aaff53393837aa7 t/100.set-cookie.t
@@ -39,7 +39,7 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
-iEYEARECAAYFAkm6aCMACgkQwoknRJZQnCGsDACdG5kbX142BvpZn4A0Jcblx4Hb
-7OEAoIf4WVhE8DUXcHmOJ5rpX9992AJa
-=UkI1
+iEYEARECAAYFAknncEgACgkQwoknRJZQnCFZCACcCnRJgWy6XiNNL739olH8vpf5
+niwAoLGjdRwE2+OhFpQmX6miHq740wgG
+=dxRw
-----END PGP SIGNATURE-----
Modified: trunk/libcgi-simple-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/debian/changelog?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/debian/changelog (original)
+++ trunk/libcgi-simple-perl/debian/changelog Sat Apr 18 17:06:12 2009
@@ -1,3 +1,9 @@
+libcgi-simple-perl (1.109-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Ryan Niebur <ryanryan52 at gmail.com> Sat, 18 Apr 2009 10:06:03 -0700
+
libcgi-simple-perl (1.108-1) unstable; urgency=low
* New upstream release
Modified: trunk/libcgi-simple-perl/lib/CGI/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple.pm?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple.pm Sat Apr 18 17:06:12 2009
@@ -13,7 +13,7 @@
$NPH $DEBUG $NO_NULL $FATAL *in
);
-$VERSION = "1.108";
+$VERSION = "1.109";
# you can hard code the global variable settings here if you want.
# warning - do not delete the unless defined $VAR part unless you
@@ -493,7 +493,7 @@
'400 No boundary supplied for multipart/form-data' );
return 0;
}
- $boundary = $self->_massage_boundary($boundary);
+ $boundary = $self->_massage_boundary( $boundary );
}
BOUNDARY:
@@ -906,12 +906,13 @@
my ( $self, @params ) = @_;
require CGI::Simple::Cookie;
require CGI::Simple::Util;
- my ( $name, $value, $path, $domain, $secure, $expires )
+ my ( $name, $value, $path, $domain, $secure, $expires, $httponly )
= CGI::Simple::Util::rearrange(
[
'NAME', [ 'VALUE', 'VALUES' ],
'PATH', 'DOMAIN',
- 'SECURE', 'EXPIRES'
+ 'SECURE', 'EXPIRES',
+ 'HTTPONLY'
],
@params
);
@@ -935,12 +936,13 @@
# If we get here, we're creating a new cookie
return undef unless $name; # this is an error
@params = ();
- push @params, '-name' => $name;
- push @params, '-value' => $value;
- push @params, '-domain' => $domain if $domain;
- push @params, '-path' => $path if $path;
- push @params, '-expires' => $expires if $expires;
- push @params, '-secure' => $secure if $secure;
+ push @params, '-name' => $name;
+ push @params, '-value' => $value;
+ push @params, '-domain' => $domain if $domain;
+ push @params, '-path' => $path if $path;
+ push @params, '-expires' => $expires if $expires;
+ push @params, '-secure' => $secure if $secure;
+ push @params, '-httponly' => $httponly if $httponly;
return CGI::Simple::Cookie->new( @params );
}
@@ -1443,7 +1445,7 @@
=head1 VERSION
-This document describes CGI::Simple version 1.108.
+This document describes CGI::Simple version 1.109.
=head1 SYNOPSIS
Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Cookie.pm Sat Apr 18 17:06:12 2009
@@ -12,7 +12,7 @@
use strict;
use vars '$VERSION';
-$VERSION = '1.108';
+$VERSION = '1.109';
use CGI::Simple::Util qw(rearrange unescape escape);
use overload '""' => \&as_string, 'cmp' => \&compare, 'fallback' => 1;
@@ -72,24 +72,27 @@
sub new {
my ( $class, @params ) = @_;
$class = ref( $class ) || $class;
- my ( $name, $value, $path, $domain, $secure, $expires ) = rearrange(
+ my ( $name, $value, $path, $domain, $secure, $expires, $httponly )
+ = rearrange(
[
'NAME', [ 'VALUE', 'VALUES' ],
'PATH', 'DOMAIN',
- 'SECURE', 'EXPIRES'
+ 'SECURE', 'EXPIRES',
+ 'HTTPONLY'
],
@params
- );
+ );
return undef unless defined $name and defined $value;
my $self = {};
bless $self, $class;
$self->name( $name );
$self->value( $value );
$path ||= "/";
- $self->path( $path ) if defined $path;
- $self->domain( $domain ) if defined $domain;
- $self->secure( $secure ) if defined $secure;
- $self->expires( $expires ) if defined $expires;
+ $self->path( $path ) if defined $path;
+ $self->domain( $domain ) if defined $domain;
+ $self->secure( $secure ) if defined $secure;
+ $self->expires( $expires ) if defined $expires;
+ $self->httponly( $httponly ) if defined $httponly;
return $self;
}
@@ -103,6 +106,7 @@
push @cookie, "path=" . $self->path if $self->path;
push @cookie, "expires=" . $self->expires if $self->expires;
push @cookie, "secure" if $self->secure;
+ push @cookie, "HttpOnly" if $self->httponly;
return join "; ", @cookie;
}
@@ -155,6 +159,12 @@
return $self->{'path'};
}
+sub httponly {
+ my ( $self, $httponly ) = @_;
+ $self->{'httponly'} = $httponly if defined $httponly;
+ return $self->{'httponly'};
+}
+
1;
__END__
@@ -243,6 +253,16 @@
If the "secure" attribute is set, the cookie will only be sent to your
script if the CGI request is occurring on a secure channel, such as SSL.
+=item B<4. HttpOnly flag>
+
+If the "httponly" attribute is set, the cookie will only be accessible
+through HTTP Requests. This cookie will be inaccessible via JavaScript
+(to prevent XSS attacks).
+
+See this URL for more information including supported browsers:
+
+L<http://www.owasp.org/index.php/HTTPOnly>
+
=back
=head2 Creating New Cookies
@@ -277,6 +297,9 @@
B<-secure> if set to a true value instructs the browser to return the
cookie only when a cryptographic protocol is in use.
+B<-httponly> if set to a true value, the cookie will not be accessible
+via JavaScript.
+
=head2 Sending the Cookie to the Browser
Within a CGI script you can send a cookie to the browser by creating
@@ -379,6 +402,14 @@
Get or set the cookie's expiration time.
+=item B<secure()>
+
+Get or set the cookie's secure flag.
+
+=item B<httponly()>
+
+Get or set the cookie's HttpOnly flag.
+
=back
Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Standard.pm Sat Apr 18 17:06:12 2009
@@ -7,7 +7,7 @@
$NO_UNDEF_PARAMS $USE_PARAM_SEMICOLONS $HEADERS_ONCE
$NPH $DEBUG $NO_NULL $FATAL *in %EXPORT_TAGS $AUTOLOAD );
-$VERSION = "1.108";
+$VERSION = "1.109";
%EXPORT_TAGS = (
':html' => [qw(:misc)],
Modified: trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm (original)
+++ trunk/libcgi-simple-perl/lib/CGI/Simple/Util.pm Sat Apr 18 17:06:12 2009
@@ -1,7 +1,7 @@
package CGI::Simple::Util;
use strict;
use vars qw( $VERSION @EXPORT_OK @ISA $UTIL );
-$VERSION = '1.108';
+$VERSION = '1.109';
require Exporter;
@ISA = qw( Exporter );
@EXPORT_OK = qw(
Modified: trunk/libcgi-simple-perl/t/020.cookie.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/020.cookie.t?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/020.cookie.t (original)
+++ trunk/libcgi-simple-perl/t/020.cookie.t Sat Apr 18 17:06:12 2009
@@ -2,7 +2,7 @@
# The only modification is to change CGI::Cookie to CGI::Simple::Cookie
# whenever it appears
-use Test::More tests => 86;
+use Test::More tests => 93;
use strict;
use CGI::Simple::Util qw(escape unescape);
use POSIX qw(strftime);
@@ -152,12 +152,13 @@
# Try new with full information provided
my $c = CGI::Simple::Cookie->new(
- -name => 'foo',
- -value => 'bar',
- -expires => '+3M',
- -domain => '.capricorn.com',
- -path => '/cgi-bin/database',
- -secure => 1
+ -name => 'foo',
+ -value => 'bar',
+ -expires => '+3M',
+ -domain => '.capricorn.com',
+ -path => '/cgi-bin/database',
+ -secure => 1,
+ -httponly => 1
);
is( ref( $c ), 'CGI::Simple::Cookie',
'new returns objects of correct type' );
@@ -170,7 +171,8 @@
);
is( $c->domain, '.capricorn.com', 'domain is correct' );
is( $c->path, '/cgi-bin/database', 'path is correct' );
- ok( $c->secure, 'secure attribute is set' );
+ ok( $c->secure, 'secure attribute is set' );
+ ok( $c->httponly, 'httponly attribute is set' );
# now try it with the only two manditory values (should also set the default path)
$c = CGI::Simple::Cookie->new(
@@ -184,7 +186,8 @@
ok( !defined $c->expires, 'expires is not set' );
ok( !defined $c->domain, 'domain attributeis not set' );
is( $c->path, '/', 'path atribute is set to default' );
- ok( !defined $c->secure, 'secure attribute is set' );
+ ok( !defined $c->secure, 'secure attribute is not set' );
+ ok( !defined $c->httponly, 'httponly attribute is not set' );
# I'm really not happy about the restults of this section. You pass
# the new method invalid arguments and it just merilly creates a
@@ -211,12 +214,13 @@
{
my $c = CGI::Simple::Cookie->new(
- -name => 'Jam',
- -value => 'Hamster',
- -expires => '+3M',
- -domain => '.pie-shop.com',
- -path => '/',
- -secure => 1
+ -name => 'Jam',
+ -value => 'Hamster',
+ -expires => '+3M',
+ -domain => '.pie-shop.com',
+ -path => '/',
+ -secure => 1,
+ -httponly => 1
);
my $name = $c->name;
@@ -240,6 +244,9 @@
like( $c->as_string, '/secure/',
"Stringified cookie contains secure" );
+ like( $c->as_string, '/HttpOnly/',
+ "Stringified cookie contains HttpOnly" );
+
$c = CGI::Simple::Cookie->new(
-name => 'Hamster-Jam',
-value => 'Tulip',
@@ -263,6 +270,9 @@
ok( $c->as_string !~ /secure/,
"Stringified cookie does not contain secure" );
+
+ ok( $c->as_string !~ /HttpOnly/,
+ "Stringified cookie does not contain HttpOnly" );
}
#-----------------------------------------------------------------------------
@@ -271,23 +281,25 @@
{
my $c1 = CGI::Simple::Cookie->new(
- -name => 'Jam',
- -value => 'Hamster',
- -expires => '+3M',
- -domain => '.pie-shop.com',
- -path => '/',
- -secure => 1
+ -name => 'Jam',
+ -value => 'Hamster',
+ -expires => '+3M',
+ -domain => '.pie-shop.com',
+ -path => '/',
+ -secure => 1,
+ -httponly => 1
);
# have to use $c1->expires because the time will occasionally be
# different between the two creates causing spurious failures.
my $c2 = CGI::Simple::Cookie->new(
- -name => 'Jam',
- -value => 'Hamster',
- -expires => $c1->expires,
- -domain => '.pie-shop.com',
- -path => '/',
- -secure => 1
+ -name => 'Jam',
+ -value => 'Hamster',
+ -expires => $c1->expires,
+ -domain => '.pie-shop.com',
+ -path => '/',
+ -secure => 1,
+ -httponly => 1
);
# This looks titally whacked, but it does the -1, 0, 1 comparison
@@ -323,12 +335,13 @@
{
my $c = CGI::Simple::Cookie->new(
- -name => 'Jam',
- -value => 'Hamster',
- -expires => '+3M',
- -domain => '.pie-shop.com',
- -path => '/',
- -secure => 1
+ -name => 'Jam',
+ -value => 'Hamster',
+ -expires => '+3M',
+ -domain => '.pie-shop.com',
+ -path => '/',
+ -secure => 1,
+ -httponly => 1
);
is( $c->name, 'Jam', 'name is correct' );
@@ -372,4 +385,8 @@
ok( $c->secure, 'secure attribute is set' );
ok( !$c->secure( 0 ), 'secure attribute is cleared' );
ok( !$c->secure, 'secure attribute is cleared' );
-}
+
+ ok( $c->httponly, 'httponly attribute is set' );
+ ok( !$c->httponly( 0 ), 'httponly attribute is cleared' );
+ ok( !$c->httponly, 'httponly attribute is cleared' );
+}
Modified: trunk/libcgi-simple-perl/t/050.simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/050.simple.t?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/050.simple.t (original)
+++ trunk/libcgi-simple-perl/t/050.simple.t Sat Apr 18 17:06:12 2009
@@ -824,12 +824,13 @@
is( $sv, undef, 'cookie(\'invalid\'), 1' );
is( join( '', @av ), '', 'cookie(\'invalid\'), 2' );
my @vals = (
- -name => 'Password',
- -value => [ 'superuser', 'god', 'open sesame', 'mydog woofie' ],
- -expires => 'Mon, 11-Nov-2018 11:00:00 GMT',
- -domain => '.nowhere.com',
- -path => '/cgi-bin/database',
- -secure => 1
+ -name => 'Password',
+ -value => [ 'superuser', 'god', 'open sesame', 'mydog woofie' ],
+ -expires => 'Mon, 11-Nov-2018 11:00:00 GMT',
+ -domain => '.nowhere.com',
+ -path => '/cgi-bin/database',
+ -secure => 1,
+ -httponly => 1
);
# cookie() - scalar and array context, full argument set, correct order
@@ -837,26 +838,28 @@
@av = $q->cookie( @vals );
is(
$sv,
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) correct order, 1'
);
is(
join( '', @av ),
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) correct order, 2'
);
# cookie() - scalar and array context, full argument set, incorrect order
-$sv = $q->cookie( @vals[ 0, 1, 10, 11, 8, 9, 2, 3, 4, 5, 6, 7 ] );
- at av = $q->cookie( @vals[ 0, 1, 10, 11, 8, 9, 2, 3, 4, 5, 6, 7 ] );
+$sv
+ = $q->cookie( @vals[ 0, 1, 10, 11, 12, 13, 8, 9, 2, 3, 4, 5, 6, 7 ] );
+ at av
+ = $q->cookie( @vals[ 0, 1, 10, 11, 12, 13, 8, 9, 2, 3, 4, 5, 6, 7 ] );
is(
$sv,
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) incorrect order, 1'
);
is(
join( '', @av ),
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) incorrect order, 2'
);
my $cookie = $sv; # save a cookie for header testing
@@ -915,7 +918,7 @@
HTTP/1.0 402 Payment required
Server: Apache - accept no substitutes
Status: 402 Payment required
-Set-Cookie: Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure
+Set-Cookie: Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly
Expires: Mon, 11-Nov-2018 11:00:00 GMT
Date: Tue, 11-Nov-2018 11:00:00 GMT
Content-Disposition: attachment; filename="foo.gif"
Modified: trunk/libcgi-simple-perl/t/070.standard.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-simple-perl/t/070.standard.t?rev=33522&op=diff
==============================================================================
--- trunk/libcgi-simple-perl/t/070.standard.t (original)
+++ trunk/libcgi-simple-perl/t/070.standard.t Sat Apr 18 17:06:12 2009
@@ -806,12 +806,13 @@
is( join( '', @av ), '', 'cookie(\'invalid\'), 2' );
my @vals = (
- -name => 'Password',
- -value => [ 'superuser', 'god', 'open sesame', 'mydog woofie' ],
- -expires => 'Mon, 11-Nov-2018 11:00:00 GMT',
- -domain => '.nowhere.com',
- -path => '/cgi-bin/database',
- -secure => 1
+ -name => 'Password',
+ -value => [ 'superuser', 'god', 'open sesame', 'mydog woofie' ],
+ -expires => 'Mon, 11-Nov-2018 11:00:00 GMT',
+ -domain => '.nowhere.com',
+ -path => '/cgi-bin/database',
+ -secure => 1,
+ -httponly => 1
);
# cookie() - scalar and array context, full argument set, correct order
@@ -820,27 +821,27 @@
@av = cookie( @vals );
is(
$sv,
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) correct order, 1'
);
is(
join( '', @av ),
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) correct order, 2'
);
# cookie() - scalar and array context, full argument set, incorrect order
-$sv = cookie( @vals[ 0, 1, 10, 11, 8, 9, 2, 3, 4, 5, 6, 7 ] );
- at av = cookie( @vals[ 0, 1, 10, 11, 8, 9, 2, 3, 4, 5, 6, 7 ] );
+$sv = cookie( @vals[ 0, 1, 10, 11, 12, 13, 8, 9, 2, 3, 4, 5, 6, 7 ] );
+ at av = cookie( @vals[ 0, 1, 10, 11, 12, 13, 8, 9, 2, 3, 4, 5, 6, 7 ] );
is(
$sv,
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) incorrect order, 1'
);
is(
join( '', @av ),
- 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure',
+ 'Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly',
'cookie(\@vals) incorrect order, 2'
);
my $cookie = $sv; # save a cookie for header testing
@@ -905,7 +906,7 @@
HTTP/1.0 402 Payment required
Server: Apache - accept no substitutes
Status: 402 Payment required
-Set-Cookie: Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure
+Set-Cookie: Password=superuser&god&open%20sesame&mydog%20woofie; domain=.nowhere.com; path=/cgi-bin/database; expires=Mon, 11-Nov-2018 11:00:00 GMT; secure; HttpOnly
Expires: Mon, 11-Nov-2018 11:00:00 GMT
Date: Tue, 11-Nov-2018 11:00:00 GMT
Content-Disposition: attachment; filename="foo.gif"
More information about the Pkg-perl-cvs-commits
mailing list