Fix overriding Jetty's User-Agent in HttpUtil (#3411)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
jimtng
2023-03-01 13:10:58 +01:00
committed by GitHub
parent ec3af50f11
commit ba7c68c05e
@@ -213,7 +213,11 @@ public class HttpUtil {
if (httpHeaders != null) {
for (String httpHeaderKey : httpHeaders.stringPropertyNames()) {
request.header(httpHeaderKey, httpHeaders.getProperty(httpHeaderKey));
if (httpHeaderKey.equalsIgnoreCase(HttpHeader.USER_AGENT.toString())) {
request.agent(httpHeaders.getProperty(httpHeaderKey));
} else {
request.header(httpHeaderKey, httpHeaders.getProperty(httpHeaderKey));
}
}
}