File tree 2 files changed +6
-7
lines changed
main/java/org/springframework/http
test/java/org/springframework/http
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -1048,9 +1048,8 @@ public long getDate() {
1048
1048
*/
1049
1049
public void setETag (@ Nullable String etag ) {
1050
1050
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 \" " );
1054
1053
set (ETAG , etag );
1055
1054
}
1056
1055
else {
Original file line number Diff line number Diff line change @@ -191,15 +191,15 @@ void ipv6Host() {
191
191
}
192
192
193
193
@ Test
194
- void illegalETag () {
194
+ void illegalETagWithoutQuotes () {
195
195
String eTag = "v2.6" ;
196
196
assertThatIllegalArgumentException ().isThrownBy (() -> headers .setETag (eTag ));
197
197
}
198
198
199
199
@ Test
200
- void illegalETagWithoutQuoteAfterWSlash () {
200
+ void illegalWeakETagWithoutLeadingQuote () {
201
201
String etag = "W/v2.6\" " ;
202
- assertThatIllegalArgumentException ().as ( "Invalid Weak ETag" ). isThrownBy (() -> headers .setETag (etag ));
202
+ assertThatIllegalArgumentException ().isThrownBy (() -> headers .setETag (etag ));
203
203
}
204
204
205
205
@ Test
You can’t perform that action at this time.
0 commit comments