File: cookie.t

package info (click to toggle)
libapache-mod-perl 1.21.20000309-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,632 kB
  • ctags: 1,295
  • sloc: perl: 7,049; ansic: 5,214; sh: 356; makefile: 171
file content (23 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use Apache::test;
use Apache::src ();
 
my $Is_dougm = (defined($ENV{USER}) && ($ENV{USER} eq "dougm"));

skip_test unless have_module "Apache::Cookie";
skip_test unless have_module "CGI::Cookie";

unless (Apache::src->mmn_eq) {
    skip_test if not $Is_dougm;
}

my $ua = LWP::UserAgent->new;

my $cookie = "one=bar-one&a; two=bar-two&b; three=bar-three&c";
my $url = "http://$net::httpserver$net::perldir/request-cookie.pl";
my $request = HTTP::Request->new('GET', $url);
$request->header(Cookie => $cookie);
my $response = $ua->request($request, undef, undef); 
 
print $response->content;