Merge branch '5.2.x' into master
This commit is contained in:
@@ -91,16 +91,6 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
|
||||
new ParameterizedTypeReference<List<ResourceRegion>>() { }.getType();
|
||||
|
||||
|
||||
private static final UrlPathHelper decodingUrlPathHelper = UrlPathHelper.defaultInstance;
|
||||
|
||||
private static final UrlPathHelper rawUrlPathHelper = new UrlPathHelper();
|
||||
|
||||
static {
|
||||
rawUrlPathHelper.setRemoveSemicolonContent(false);
|
||||
rawUrlPathHelper.setUrlDecode(false);
|
||||
}
|
||||
|
||||
|
||||
private final ContentNegotiationManager contentNegotiationManager;
|
||||
|
||||
private final Set<String> safeExtensions = new HashSet<>();
|
||||
@@ -430,7 +420,7 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
|
||||
}
|
||||
|
||||
HttpServletRequest servletRequest = request.getServletRequest();
|
||||
String requestUri = rawUrlPathHelper.getOriginatingRequestUri(servletRequest);
|
||||
String requestUri = UrlPathHelper.rawPathInstance.getOriginatingRequestUri(servletRequest);
|
||||
|
||||
int index = requestUri.lastIndexOf('/') + 1;
|
||||
String filename = requestUri.substring(index);
|
||||
@@ -442,10 +432,10 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
|
||||
filename = filename.substring(0, index);
|
||||
}
|
||||
|
||||
filename = decodingUrlPathHelper.decodeRequestString(servletRequest, filename);
|
||||
filename = UrlPathHelper.defaultInstance.decodeRequestString(servletRequest, filename);
|
||||
String ext = StringUtils.getFilenameExtension(filename);
|
||||
|
||||
pathParams = decodingUrlPathHelper.decodeRequestString(servletRequest, pathParams);
|
||||
pathParams = UrlPathHelper.defaultInstance.decodeRequestString(servletRequest, pathParams);
|
||||
String extInPathParams = StringUtils.getFilenameExtension(pathParams);
|
||||
|
||||
if (!safeExtension(servletRequest, ext) || !safeExtension(servletRequest, extInPathParams)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
|
||||
Reference in New Issue
Block a user