File tree 1 file changed +6
-2
lines changed
spring-web/src/main/java/org/springframework/http/client/reactive
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 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,8 +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
- .flatMap (List ::stream ).map (HttpCookie ::toString ).collect (Collectors .joining (";" )));
112
+ MultiValueMap <String , HttpCookie > cookies = getCookies ();
113
+ if (!cookies .isEmpty ()) {
114
+ this .builder .header (HttpHeaders .COOKIE , cookies .values ().stream ()
115
+ .flatMap (List ::stream ).map (HttpCookie ::toString ).collect (Collectors .joining (";" )));
116
+ }
113
117
}
114
118
115
119
@ Override
You can’t perform that action at this time.
0 commit comments