Am 2020-08-11 um 16:52 schrieb ma...@apache.org:
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
      new bef507e  Improve entity tag handling
bef507e is described below

commit bef507e1b7ac2eb0ff012d0d40035e218a5839cc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Aug 11 15:27:45 2020 +0100

     Improve entity tag handling
---
  conf/web.xml                                       |   8 ++
  .../apache/catalina/servlets/DefaultServlet.java   | 116 +++++++++--------
  .../apache/tomcat/util/http/parser/EntityTag.java  |  82 ++++++++++++
  .../TestDefaultServletIfMatchRequests.java         | 143 +++++++++++++++++----
  webapps/docs/changelog.xml                         |   7 +
  webapps/docs/default-servlet.xml                   |   8 +-
  6 files changed, 284 insertions(+), 80 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index a685947..b5e0b30 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -114,6 +114,14 @@
    <!--                       with a Range header as a partial PUT? Note     
-->
    <!--                       that RFC 7233 clarified that Range headers are 
-->
    <!--                       only valid for GET requests. [true]            
-->
+  <!--                                                                      -->
+  <!--   useWeakComparisonWithIfMatch                                       -->
+  <!--                       When comparing entity tags for If-Match        -->
+  <!--                       headers should a weak comparison be used       -->
+  <!--                       rather than the strong comparison required by  -->
+  <!--                       RFC 7232? A weak comparison is used by default -->
+  <!--                       since the default resources implementation     -->
+  <!--                       generates weak entity tags. [true]             -->
...

@@ -279,6 +280,8 @@ public class DefaultServlet extends HttpServlet {
       */
      private boolean allowPartialPut = true;
+ protected boolean useWeakComparisonWithIfMatch = true;

I really must object this. It clearly violates RFC 7232, section 3.1:
   An origin server MUST use the strong comparison function when
   comparing entity-tags for If-Match...

Even an option for this is wrong. I agree that we cannto produce strong ETags by default, but it is now better decoupled and a subclass can handle this. Please retain the semantics as described in RFC 7232.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to