File: 12_head_no_body.t

package info (click to toggle)
libanyevent-httpd-perl 0.93-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 244 kB
  • sloc: perl: 1,247; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 514 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
#!perl
use common::sense;
use Test::More tests => 1;
use AnyEvent::Impl::Perl;
use AnyEvent;
use AnyEvent::HTTPD;
use AnyEvent::Socket;

my $h = AnyEvent::HTTPD->new;

$h->reg_cb (
   '/test' => sub {
      my ($httpd, $req) = @_;
      $req->respond ({ content => ['text/plain', "31337"] });
   },
);

my $c = AnyEvent::HTTPD::Util::test_connect ('127.0.0.1', $h->port,
            "HEAD\040http://localhost:19090/test\040HTTP/1.0\015\012\015\012");
my $buf = $c->recv;

ok ($buf !~ /31337/, "no body received");