Skip to content

Commit

Permalink
Merge pull request #18919 from stuartwdouglas/18890
Browse files Browse the repository at this point in the history
Add connection: close if the server is shut down
  • Loading branch information
stuartwdouglas authored Jul 22, 2021
2 parents 65cca51 + 2105c29 commit dd1e7a3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.jboss.logging.Logger;

import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.quarkus.runtime.shutdown.ShutdownListener;
import io.vertx.core.Handler;
Expand Down Expand Up @@ -40,7 +41,8 @@ public void handle(Void event) {
@Override
public void handle(HttpServerRequest event) {
if (!running) {
event.response().setStatusCode(HttpResponseStatus.SERVICE_UNAVAILABLE.code()).end();
event.response().setStatusCode(HttpResponseStatus.SERVICE_UNAVAILABLE.code())
.putHeader(HttpHeaderNames.CONNECTION, "close").end();
return;
}
currentRequestCount.incrementAndGet();
Expand Down

0 comments on commit dd1e7a3

Please sign in to comment.