8

# HTTP::Negotiate

    sub accepts_gzip {
      my $r = shift;
      my $ae = $r->header_in("Accept-Encoding");
      require HTTP::Negotiate;
      require HTTP::Headers;
      my $hhh = HTTP::Headers->new("Accept-Encoding", $ae);

      my $variants = [
    ['identity', 0.1, undef, 'identity', undef, undef, undef],
    ['gzip',       1, undef, 'gzip',     undef, undef, undef],
    ];

      my $choose = HTTP::Negotiate::choose($variants, $hhh);
      $choose->[0] eq "gzip";
    }