Skip to content

Commit fc37824

Browse files
rstoyanchevjhoeller
authored andcommitted
Improve static resource path check
(cherry picked from commit 2697425)
1 parent 2b9c527 commit fc37824

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -281,7 +281,7 @@ protected boolean isInvalidPath(String path) {
281281
return true;
282282
}
283283
}
284-
if (path.contains("../")) {
284+
if (path.contains("..")) {
285285
path = StringUtils.cleanPath(path);
286286
if (path.contains("../")) {
287287
if (logger.isTraceEnabled()) {

0 commit comments

Comments
 (0)