use of org.springframework.cloud.gateway.filter.headers.HttpHeadersFilter in project spring-cloud-gateway by spring-cloud.
the class WebsocketRoutingFilter method getHeadersFilters.
private List<HttpHeadersFilter> getHeadersFilters() {
List<HttpHeadersFilter> filters = this.headersFilters.getIfAvailable();
if (filters == null) {
filters = new ArrayList<>();
}
filters.add((headers, exchange) -> {
HttpHeaders filtered = new HttpHeaders();
headers.entrySet().stream().filter(entry -> !entry.getKey().toLowerCase().startsWith("sec-websocket")).forEach(header -> filtered.addAll(header.getKey(), header.getValue()));
return filtered;
});
return filters;
}
Aggregations