File: iis7_keep_alive_fix.t

package info (click to toggle)
libplack-perl 1.0048-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,480 kB
  • sloc: perl: 5,288; python: 7; makefile: 4; javascript: 1
file content (41 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use strict;
use Test::More;
use Plack::Test;
use HTTP::Request::Common;
use Plack::Middleware::IIS7KeepAliveFix;


my $app=Plack::Middleware::IIS7KeepAliveFix->wrap(
sub {
    my $env = shift;


    my $location='/go/?'.join('|', (0..1000));
      return [ 302, [
        'Content-Type' => 'text/html',
        'Content-Length' => 285,
        'Location' => $location,
      ],[qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Moved</title>
  </head>
  <body>
     <p>This item has moved <a href="$location">here</a>.</p>
  </body>
</html>~] ];
});


test_psgi(app=>$app,client=> sub {
    my $cb = shift;

    my $res = $cb->(GET "/");

    ok(!$res->content);
    ok(!$res->content_length);
    ok(!$res->content_type);
});

done_testing;