commit | 43c8a4ab0383c124c1a786b48d42738cb15c7405 | [log] [tgz] |
---|---|---|
author | Rikard Almgren <rikardal@axis.com> | Mon Apr 20 16:16:59 2020 +0200 |
committer | Rikard Almgren <rikardal@axis.com> | Tue Apr 21 10:26:49 2020 +0200 |
tree | 1f4db4a6bf0c0f3b7837c4aaa7ec9f25fef8c3e2 | |
parent | 0564bc63d6e199ff8390b13aff62e527ca3036a0 [diff] |
Add login-redirect clause for gitiles Attempting to access a gitiles link while not logged in currently causes a "Cannot parse URL as a Gitiles URL" error instead of being redirected to log in. If the path contains plugins and gitiles, redirect, else don't. Change-Id: Icd1f5df84905592329b275648aacea6f3219be08
diff --git a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java index 3da3598..ae056b0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java +++ b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
@@ -46,7 +46,7 @@ || path.equals("/login") || path.startsWith("/login/") || path.equals("/oauth") - || path.startsWith("/plugins/") + || (path.startsWith("/plugins/") && !path.startsWith("/plugins/gitiles/")) || path.equals("/ssh_info") || path.startsWith("/static/") || path.startsWith("/tools/hooks/")