Delete unnecessary GerritCacheControlFilter

Instead we can bind it with a Key and configure it as a singleton.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-07-28 07:11:26 -07:00
parent caaf64a38c
commit 1ca6eab83e
2 changed files with 5 additions and 23 deletions

View File

@@ -1,22 +0,0 @@
// Copyright (C) 2009 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server;
import com.google.gwtexpui.server.CacheControlFilter;
import com.google.inject.Singleton;
@Singleton
class GerritCacheControlFilter extends CacheControlFilter {
}

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.server;
import com.google.gerrit.git.WorkQueue;
import com.google.gerrit.server.patch.PatchDetailServiceSrv;
import com.google.gerrit.server.ssh.SshServlet;
import com.google.gwtexpui.server.CacheControlFilter;
import com.google.gwtjsonrpc.server.XsrfException;
import com.google.gwtorm.client.OrmException;
import com.google.inject.AbstractModule;
@@ -25,6 +26,7 @@ import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.Scopes;
import com.google.inject.servlet.GuiceServletContextListener;
import com.google.inject.servlet.ServletModule;
@@ -41,7 +43,9 @@ public class GerritServletConfig extends GuiceServletContextListener {
@Override
protected void configureServlets() {
filter("/*").through(UrlRewriteFilter.class);
filter("/*").through(GerritCacheControlFilter.class);
filter("/*").through(Key.get(CacheControlFilter.class));
bind(Key.get(CacheControlFilter.class)).in(Scopes.SINGLETON);
serve("/Gerrit", "/Gerrit/*").with(HostPageServlet.class);
serve("/prettify/*").with(PrettifyServlet.class);