Apache-HEADRegistry

 view release on metacpan or  search on metacpan

HEADRegistry.pm  view on Meta::CPAN

  my $dlm = "\015?\012"; # a bit borrowed from LWP::UserAgent
  my ($key, $value);

  unless ($r->sent_header) {
    # if we have already sent the headers, no reason to scan the output

    while((my $header, $data) = split /$dlm/, $data, 2) {
      # scan the incoming data for headers

      if ($header && $header =~ m/^(\S+?):\s*(.*)$/) {
        # if the data looks like a header, add it to the header table

        ($key, $value) = ($1, $2);

        last unless $key;

        $r->cgi_header_out($key, $value);
      }
      else {
        # since we're done with the headers, send them along...



( run in 0.462 second using v1.01-cache-2.11-cpan-64827b87656 )