File tree Expand file tree Collapse file tree
main/java/org/springframework/http
test/java/org/springframework/http Expand file tree Collapse file tree 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 */
10491049 public void setETag (@ Nullable String etag ) {
10501050 if (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 \" " );
10541053 set (ETAG , etag );
10551054 }
10561055 else {
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 () {
195195 String eTag = "v2.6" ;
196196 assertThatIllegalArgumentException ().isThrownBy (() -> headers .setETag (eTag ));
197197 }
198198
199199 @ Test
200- void illegalETagWithoutQuoteAfterWSlash () {
200+ void illegalWeakETagWithoutLeadingQuote () {
201201 String 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