Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http response header so that the connection will be close after each Http request. #185

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/org/graylog2/inputs/http/GELFHttpHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ private void writeResponse(Channel channel, boolean keepAlive, HttpVersion httpR

if (keepAlive) {
response.setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);

//Set Http Response Headers to close connection after each request
//And allow CORS.
response.setHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN, "*");
response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, 0);
}

final ChannelFuture channelFuture = channel.write(response);
Expand Down