浏览代码

fix: add JavaDoc warning to avoid using ResponseWriter for directories (#12324)

* fix: add JavaDoc warning to avoid using ResponseWriter for directories

Cherry-picked from: https://github.com/vaadin/flow/pull/11112
tags/8.14.0.alpha1
Anna Koskinen 2 年前
父节点
当前提交
ba02350206
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      server/src/main/java/com/vaadin/server/VaadinServlet.java

+ 7
- 0
server/src/main/java/com/vaadin/server/VaadinServlet.java 查看文件

@@ -943,6 +943,13 @@ public class VaadinServlet extends HttpServlet implements Constants {
/**
* Writes the contents of the given resourceUrl in the response. Can be
* overridden to add/modify response headers and similar.
* <p>
* WARNING: note that this should not be used for a {@code resourceUrl} that
* represents a directory! For security reasons, the directory contents
* should not be ever written into the {@code response}, and the
* implementation which is used for setting the content length relies on
* {@link URLConnection#getContentLength()} method which returns incorrect
* values for directories.
*
* @param request
* The request for the resource

正在加载...
取消
保存