File tree 1 file changed +7
-2
lines changed
spring-web/src/main/java/org/springframework/http/client/reactive
1 file changed +7
-2
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.
37
37
import org .springframework .http .HttpHeaders ;
38
38
import org .springframework .http .HttpMethod ;
39
39
import org .springframework .util .Assert ;
40
+ import org .springframework .util .MultiValueMap ;
40
41
41
42
/**
42
43
* {@link ClientHttpRequest} for the Java {@link HttpClient}.
@@ -108,7 +109,11 @@ protected void applyHeaders() {
108
109
109
110
@ Override
110
111
protected void applyCookies () {
111
- this .builder .header (HttpHeaders .COOKIE , getCookies ().values ().stream ()
112
+ MultiValueMap <String , HttpCookie > cookies = getCookies ();
113
+ if (cookies .isEmpty ()) {
114
+ return ;
115
+ }
116
+ this .builder .header (HttpHeaders .COOKIE , cookies .values ().stream ()
112
117
.flatMap (List ::stream ).map (HttpCookie ::toString ).collect (Collectors .joining (";" )));
113
118
}
114
119
You can’t perform that action at this time.
0 commit comments