File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed 
main/java/org/springframework/http 
test/java/org/springframework/http Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 11/* 
2-  * Copyright 2002-2023  the original author or authors. 
2+  * Copyright 2002-2024  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. 
@@ -1048,9 +1048,8 @@ public long getDate() {
10481048 */ 
10491049public  void  setETag (@ Nullable  String  etag ) {
10501050if  (etag  != null ) {
1051- Assert .isTrue (etag .startsWith ("\" " ) || etag .startsWith ("W/\" " ),
1052- "Invalid ETag: does not start with W/\"  or \" " );
1053- Assert .isTrue (etag .endsWith ("\" " ), "Invalid ETag: does not end with \" " );
1051+ Assert .isTrue (etag .startsWith ("\" " ) || etag .startsWith ("W/\" " ), "ETag does not start with W/\"  or \" " );
1052+ Assert .isTrue (etag .endsWith ("\" " ), "ETag does not end with \" " );
10541053set (ETAG , etag );
10551054}
10561055else  {
Original file line number Diff line number Diff line change @@ -191,15 +191,15 @@ void ipv6Host() {
191191}
192192
193193@ Test 
194- void  illegalETag () {
194+ void  illegalETagWithoutQuotes () {
195195String  eTag  = "v2.6" ;
196196assertThatIllegalArgumentException ().isThrownBy (() -> headers .setETag (eTag ));
197197}
198198
199199@ Test 
200- void  illegalETagWithoutQuoteAfterWSlash () {
200+ void  illegalWeakETagWithoutLeadingQuote () {
201201String  etag  = "W/v2.6\" " ;
202- assertThatIllegalArgumentException ().as ( "Invalid Weak ETag" ). isThrownBy (() -> headers .setETag (etag ));
202+ assertThatIllegalArgumentException ().isThrownBy (() -> headers .setETag (etag ));
203203}
204204
205205@ Test 
                         You can’t perform that action at this time. 
           
                  
0 commit comments