-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Consider this method that configures the response:
private static void setReturnAsNotChanged(ProxyContext context) {
// @formatter:off
context.response()
.setBody(null)
.setStatusCode(Response.Status.NOT_MODIFIED.getStatusCode())
.setStatusMessage(Response.Status.NOT_MODIFIED.getReasonPhrase())
.headers()
.remove(HttpHeaders.CONTENT_LENGTH)
.remove(HttpHeaders.CONTENT_TYPE)
.remove(HttpHeaders.CONTENT_ENCODING);
// @formatter:on
}The body is set to null because the user doesn't want to send anything to the client.
When context.sendResponse() is invoked, the returned future is never completed.
This happens because the completionHander is not invoked when the body is null:
vertx-http-proxy/src/main/java/io/vertx/httpproxy/impl/ProxiedResponse.java
Lines 219 to 222 in 2217655
| if (body == null) { | |
| proxiedResponse.end(); | |
| return; | |
| } |
turing85
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working