Allow Spring Vault usage with Spring Framework 4.2.

PrefixAwareUriTemplateHandler now overrides expand(…) methods of DefaultUriTemplateHandler instead of expandInternal(…). expandInternal was added with Spring 4.3. Usage of Spring Framework 4.2 does not process the URI template which leaves the basepath and relative path untouched. This code path also does not add missing slashes which resulted in invalid context paths.

See gh-265.
This commit is contained in:
Mark Paluch
2018-07-27 13:41:05 +02:00
parent f1593cc2de
commit 9c2940e265

View File

@@ -152,13 +152,13 @@ public class VaultClients {
}
@Override
protected URI expandInternal(String uriTemplate, Map<String, ?> uriVariables) {
return super.expandInternal(prepareUriTemplate(uriTemplate), uriVariables);
public URI expand(String uriTemplate, Map<String, ?> uriVariables) {
return super.expand(prepareUriTemplate(uriTemplate), uriVariables);
}
@Override
protected URI expandInternal(String uriTemplate, Object... uriVariables) {
return super.expandInternal(prepareUriTemplate(uriTemplate), uriVariables);
public URI expand(String uriTemplate, Object... uriVariableValues) {
return super.expand(prepareUriTemplate(uriTemplate), uriVariableValues);
}
@Override