This commit is contained in:
@@ -121,7 +121,6 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
} else {
|
} else {
|
||||||
this.requestURI = array.toDecodeString(index, offset - index, charset).trim();
|
this.requestURI = array.toDecodeString(index, offset - index, charset).trim();
|
||||||
}
|
}
|
||||||
if (this.requestURI.contains("../")) return -1;
|
|
||||||
index = ++offset;
|
index = ++offset;
|
||||||
this.protocol = array.toString(index, array.size() - index, charset).trim();
|
this.protocol = array.toString(index, array.size() - index, charset).trim();
|
||||||
while (readLine(buffer, array)) {
|
while (readLine(buffer, array)) {
|
||||||
|
|||||||
@@ -192,6 +192,11 @@ public class HttpResourceServlet extends HttpServlet {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(HttpRequest request, HttpResponse response) throws IOException {
|
public void execute(HttpRequest request, HttpResponse response) throws IOException {
|
||||||
String uri = request.getRequestURI();
|
String uri = request.getRequestURI();
|
||||||
|
if (uri.contains("../")) {
|
||||||
|
if (finest) logger.log(Level.FINEST, "Not found resource (404) be " + uri + ", request = " + request);
|
||||||
|
response.finish404();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (locationRewrites != null) {
|
if (locationRewrites != null) {
|
||||||
for (SimpleEntry<Pattern, String> entry : locationRewrites) {
|
for (SimpleEntry<Pattern, String> entry : locationRewrites) {
|
||||||
Matcher matcher = entry.getKey().matcher(uri);
|
Matcher matcher = entry.getKey().matcher(uri);
|
||||||
|
|||||||
Reference in New Issue
Block a user