Skip to content

Commit ac29523

Browse files
committed
Fix StaticCodingStrategy
This gets also called for the links to the repositories in the ProjectPage. If we don't handle it, we should make sure the url gets the default treatment, and not just return it unchanged.
1 parent 7a3c71f commit ac29523

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/com/googlesource/gerrit/plugins/gitblit/app/StaticCodingStrategy.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ public StaticCodingStrategy(String... ignoreResourceUrlPrefixes) {
3131
public String rewriteStaticRelativeUrl(String url) {
3232
// Avoid rewriting of non-static resources
3333
String[] urlParts = url.split("/");
34-
if (urlParts[urlParts.length - 1].indexOf('.') < 0) {
35-
return url;
36-
}
37-
38-
if (isMatchingIgnoreUrlPrefixes(url)) {
39-
return url;
34+
if (urlParts[urlParts.length - 1].indexOf('.') < 0 || isMatchingIgnoreUrlPrefixes(url)) {
35+
return super.rewriteStaticRelativeUrl(url);
4036
}
4137

4238
int depth = ((ServletWebRequest) RequestCycle.get().getRequest()).getDepthRelativeToWicketHandler();

0 commit comments

Comments
 (0)