mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-16 09:02:24 +00:00
Prefer config supplied content-type and accept header.
Original Pull Request #2328 Closes #2327
This commit is contained in:
parent
8bb3474c05
commit
02b6d54cc9
@ -256,6 +256,15 @@ public interface WebClientProvider {
|
|||||||
HttpHeaders suppliedHeaders = clientConfiguration.getHeadersSupplier().get();
|
HttpHeaders suppliedHeaders = clientConfiguration.getHeadersSupplier().get();
|
||||||
|
|
||||||
if (suppliedHeaders != null && suppliedHeaders != HttpHeaders.EMPTY) {
|
if (suppliedHeaders != null && suppliedHeaders != HttpHeaders.EMPTY) {
|
||||||
|
|
||||||
|
// remove content-type and accept if they are provided by the client configuration (ES7 compatibility headers)
|
||||||
|
if (suppliedHeaders.containsKey(HttpHeaders.CONTENT_TYPE)) {
|
||||||
|
httpHeaders.remove(HttpHeaders.CONTENT_TYPE);
|
||||||
|
}
|
||||||
|
if (suppliedHeaders.containsKey(HttpHeaders.ACCEPT)) {
|
||||||
|
httpHeaders.remove(HttpHeaders.ACCEPT);
|
||||||
|
}
|
||||||
|
|
||||||
httpHeaders.addAll(suppliedHeaders);
|
httpHeaders.addAll(suppliedHeaders);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user