Permalink
Browse files

rewrite-options: don't turn on CoreFilters just because of query para…

…ms (#1228)

Fixes #1190
  • Loading branch information...
jeffkaufman authored and crowell committed Aug 4, 2016
1 parent 61f36e0 commit 2af2035bbd8979744aaf5a7fbd24c3192933f186
Showing with 20 additions and 1 deletion.
  1. +9 −0 src/ngx_rewrite_driver_factory.cc
  2. +2 −1 src/ngx_rewrite_driver_factory.h
  3. +9 −0 test/pagespeed_test.conf.template
@@ -147,10 +147,19 @@ NamedLockManager* NgxRewriteDriverFactory::DefaultLockManager() {

RewriteOptions* NgxRewriteDriverFactory::NewRewriteOptions() {
NgxRewriteOptions* options = new NgxRewriteOptions(thread_system());
// TODO(jefftk): figure out why using SetDefaultRewriteLevel like
// mod_pagespeed does in mod_instaweb.cc:create_dir_config() isn't enough here
// -- if you use that instead then ngx_pagespeed doesn't actually end up
// defaulting CoreFilters.
// See: https://github.com/pagespeed/ngx_pagespeed/issues/1190
options->SetRewriteLevel(RewriteOptions::kCoreFilters);
return options;
}

RewriteOptions* NgxRewriteDriverFactory::NewRewriteOptionsForQuery() {
return new NgxRewriteOptions(thread_system());
}

bool NgxRewriteDriverFactory::CheckResolver() {
if (use_native_fetcher_ && resolver_ == NULL) {
return false;
@@ -63,8 +63,9 @@ class NgxRewriteDriverFactory : public SystemRewriteDriverFactory {
virtual Timer* DefaultTimer();
virtual NamedLockManager* DefaultLockManager();
// Create a new RewriteOptions. In this implementation it will be an
// NgxRewriteOptions.
// NgxRewriteOptions, and it will have CoreFilters explicitly set.
virtual RewriteOptions* NewRewriteOptions();
virtual RewriteOptions* NewRewriteOptionsForQuery();
virtual ServerContext* NewDecodingServerContext();
// Check resolver configured or not.
bool CheckResolver();
@@ -1559,6 +1559,15 @@ http {
pagespeed FileCachePath "@@FILE_CACHE@@";
}

server {
pagespeed on;
listen @@SECONDARY_PORT@@;
listen [::]:@@SECONDARY_PORT@@;
server_name debug-filters.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters debug;
}
server {
listen @@PRIMARY_PORT@@;
listen [::]:@@PRIMARY_PORT@@;

0 comments on commit 2af2035

Please sign in to comment.