VersionResourceResolver should delegate to the chain

Prior to this commit, the `VersionResourceResolver` implementations of
`resolveUrlPathInternal` would delegate to the resolver chain but would
never use the give result if the current request didn't match a
configured version strategy pattern.

This is a problem if the resolver supposed to resolve the resource path
is configured after a `VersionResourceResolver` in the resolver chain;
this means that other resolver never gets to participate in the result
of the chain.

Issue: SPR-15372
This commit is contained in:
Brian Clozel
2017-03-24 14:14:43 +01:00
parent 65ba865d70
commit fdd503152d
4 changed files with 21 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -206,7 +206,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
if (StringUtils.hasText(baseUrl)) {
VersionStrategy versionStrategy = getStrategyForPath(resourceUrlPath);
if (versionStrategy == null) {
return null;
return baseUrl;
}
if (logger.isTraceEnabled()) {
logger.trace("Getting the original resource to determine version for path \"" + resourceUrlPath + "\"");