use of com.gitblit.extensions.HttpRequestFilter in project gitblit by gitblit.
the class ProxyFilter method init.
@Override
public void init(FilterConfig filterConfig) throws ServletException {
filters.addAll(pluginManager.getExtensions(HttpRequestFilter.class));
for (HttpRequestFilter f : filters) {
// wrap the filter config for Gitblit settings retrieval
PluginWrapper pluginWrapper = pluginManager.whichPlugin(f.getClass());
FilterConfig runtimeConfig = new FilterRuntimeConfig(runtimeManager, pluginWrapper.getPluginId(), filterConfig);
f.init(runtimeConfig);
}
}
use of com.gitblit.extensions.HttpRequestFilter in project gitblit by gitblit.
the class ProxyFilter method doFilter.
@Override
public void doFilter(ServletRequest req, ServletResponse res, final FilterChain last) throws IOException, ServletException {
final Iterator<HttpRequestFilter> itr = filters.iterator();
new FilterChain() {
@Override
public void doFilter(ServletRequest req, ServletResponse res) throws IOException, ServletException {
if (itr.hasNext()) {
itr.next().doFilter(req, res, this);
} else {
last.doFilter(req, res);
}
}
}.doFilter(req, res);
}
Aggregations