From 8a048daee758c819ca46c480163cfedd6cf6cb31 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Tue, 8 Mar 2016 15:35:52 +0100 Subject: [PATCH] Item14011: make sure HTTP2 is compressing HTML Item13969: reverting parsing path_info as long as we don't have a better solution the current one was beaking jsonrpc --- core/lib/Foswiki.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/lib/Foswiki.pm b/core/lib/Foswiki.pm index 128bbdca51..93892e4b94 100644 --- a/core/lib/Foswiki.pm +++ b/core/lib/Foswiki.pm @@ -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'; @@ -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; @@ -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');