use of io.vertx.reactivex.ext.web.client.HttpRequest in project knotx by Cognifide.
the class HttpClientFacade method updateRequestHeaders.
private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest, ServiceMetadata serviceMetadata) {
MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(), serviceMetadata.getAllowedRequestHeaderPatterns());
filteredHeaders.names().forEach(headerName -> filteredHeaders.getAll(headerName).forEach(value -> request.headers().add(headerName, value)));
if (customRequestHeader.containsKey("name") && customRequestHeader.containsKey("value")) {
request.headers().set(customRequestHeader.getString("name"), customRequestHeader.getString("value"));
}
}
Aggregations