Skip to content

Commit 525a5b2

Browse files
committed
Fix Java syntax error in header comparison
1 parent de8da51 commit 525a5b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/logstash/plugins/inputs/http/MessageProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ private FullHttpResponse generateResponse(Map<String, String> stringHeaders) {
102102
req.protocolVersion(),
103103
responseStatus);
104104
final DefaultHttpHeaders headers = new DefaultHttpHeaders();
105-
bool hasContentTypeHeader = false;
105+
boolean hasContentTypeHeader = false;
106106
for(String key : stringHeaders.keySet()) {
107107
headers.set(key, stringHeaders.get(key));
108-
hasContentTypeHeader = (key.toLowerCase() == HttpHeaderNames.CONTENT_TYPE);
108+
hasContentTypeHeader = (HttpHeaderNames.CONTENT_TYPE.contentEqualsIgnoreCase(key));
109109
}
110110
if (!hasContentTypeHeader) {
111111
headers.set(HttpHeaderNames.CONTENT_TYPE, "text/plain");

0 commit comments

Comments
 (0)