Stop filtering Gerrti's static resources with OAuthFilter When static resources (e.g. `woff2` fonts) are reached out from client they shouldn't be filtered out with OAuthFilter. Note that existing extensions were sorted and enriched with additional extensions from Gerrit's `ResourceServlet.java` (see [1] for details). Note that `html` files are resource files from Gerrit's perspective however GitHub plugin's functionality relies on processing and expanding them hence they are from this perspective not static. [1]: https://gerrit.googlesource.com/gerrit/+/refs/heads/master/java/com/google/gerrit/httpd/raw/ResourceServlet.java#67 Bug: Issue 40015390 Change-Id: I22f05f07f18c516db76a94fe2b9d4f20f55bc422
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthFilter.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthFilter.java index 425755f..b15c8e5 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthFilter.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthFilter.java
@@ -37,7 +37,9 @@ private static final org.slf4j.Logger log = LoggerFactory.getLogger(OAuthFilter.class); private static Pattern GIT_HTTP_REQUEST_PATTERN = Pattern.compile(GitOverHttpServlet.URL_REGEX); private static final Set<String> GERRIT_STATIC_RESOURCES_EXTS = - Sets.newHashSet("css", "png", "jpg", "gif", "woff", "otf", "ttf", "map", "js", "swf", "txt"); + Sets.newHashSet( + "css", "gif", "ico", "jpeg", "jpg", "js", "map", "otf", "pdf", "png", "rtf", "svg", "swf", + "text", "tif", "tiff", "ttf", "txt", "woff", "woff2"); private static final Set<String> GERRIT_ALLOWED_PATHS = Sets.newHashSet("Documentation"); private static final Set<String> GERRIT_ALLOWED_PAGES = Sets.newHashSet("scope.html");