Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -96,7 +96,7 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
|
|||||||
*/
|
*/
|
||||||
protected String toAbsolutePath(String path, ServerWebExchange exchange) {
|
protected String toAbsolutePath(String path, ServerWebExchange exchange) {
|
||||||
String requestPath = exchange.getRequest().getURI().getPath();
|
String requestPath = exchange.getRequest().getURI().getPath();
|
||||||
String absolutePath = path.startsWith("/") ? path : StringUtils.applyRelativePath(requestPath, path);
|
String absolutePath = (path.startsWith("/") ? path : StringUtils.applyRelativePath(requestPath, path));
|
||||||
return StringUtils.cleanPath(absolutePath);
|
return StringUtils.cleanPath(absolutePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -95,7 +95,7 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
|
|||||||
*/
|
*/
|
||||||
protected String toAbsolutePath(String path, HttpServletRequest request) {
|
protected String toAbsolutePath(String path, HttpServletRequest request) {
|
||||||
String absolutePath = path;
|
String absolutePath = path;
|
||||||
if(!path.startsWith("/")) {
|
if (!path.startsWith("/")) {
|
||||||
ResourceUrlProvider urlProvider = findResourceUrlProvider(request);
|
ResourceUrlProvider urlProvider = findResourceUrlProvider(request);
|
||||||
Assert.state(urlProvider != null, "No ResourceUrlProvider");
|
Assert.state(urlProvider != null, "No ResourceUrlProvider");
|
||||||
String requestPath = urlProvider.getUrlPathHelper().getRequestUri(request);
|
String requestPath = urlProvider.getUrlPathHelper().getRequestUri(request);
|
||||||
|
|||||||
Reference in New Issue
Block a user