Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe4fd00

Browse files
committed
Polishing contribution
Closesgh-33374
1 parent1703b71 commitfe4fd00

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

‎spring-web/src/main/java/org/springframework/http/HttpHeaders.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
publicvoidsetETag(@NullableStringetag) {
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 {

‎spring-web/src/test/java/org/springframework/http/HttpHeadersTests.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ void ipv6Host() {
191191
}
192192

193193
@Test
194-
voidillegalETag() {
194+
voidillegalETagWithoutQuotes() {
195195
StringeTag ="v2.6";
196196
assertThatIllegalArgumentException().isThrownBy(() ->headers.setETag(eTag));
197197
}
198198

199199
@Test
200-
voidillegalETagWithoutQuoteAfterWSlash() {
200+
voidillegalWeakETagWithoutLeadingQuote() {
201201
Stringetag ="W/v2.6\"";
202-
assertThatIllegalArgumentException().as("Invalid Weak ETag").isThrownBy(() ->headers.setETag(etag));
202+
assertThatIllegalArgumentException().isThrownBy(() ->headers.setETag(etag));
203203
}
204204

205205
@Test

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp