Skip to content

Commit

Permalink
Item14011: make sure HTTP2 is compressing HTML
Browse files Browse the repository at this point in the history
Item13969: reverting parsing path_info as long as we don't have a better solution

the current one was beaking jsonrpc
  • Loading branch information
MichaelDaum committed Mar 8, 2016
1 parent 8bb4bad commit 8a048da
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/lib/Foswiki.pm
Expand Up @@ -811,7 +811,6 @@ BOGUS

# Generate a zipped page, if the client accepts them

# SMELL: $ENV{SPDY} is a non-standard way to detect spdy protocol
if ( my $encoding = _gzipAccepted() ) {
$hopts->{'Content-Encoding'} = $encoding;
$hopts->{'Vary'} = 'Accept-Encoding';
Expand Down Expand Up @@ -850,7 +849,9 @@ sub _gzipAccepted {
{
$encoding = $1;
}
elsif ( $ENV{'SPDY'} ) {
elsif ( $ENV{'HTTP2'} ) {

# SMELL: $ENV{'HTTP2'} is a non-standard way to detect http2 protocol
$encoding = 'gzip';
}
return $encoding;
Expand Down Expand Up @@ -2207,10 +2208,7 @@ sub new {
my $defaultweb = $query->param('defaultweb') || $Foswiki::cfg{UsersWebName};

# Scripts like rest, jsonrpc, don't use web/topic path.
my $webtopic = '';
unless ( $query->action() eq 'rest' || $query->action() eq 'jsonrpc' ) {
$webtopic = urlDecode( $query->path_info() || '' );
}
my $webtopic = urlDecode( $query->path_info() || '' );

my $topicOverride = '';
my $topic = $query->param('topic');
Expand Down

0 comments on commit 8a048da

Please sign in to comment.