mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-01 14:07:54 +01:00
HEAD response no longer sends response body
Affects issues: - Fixed #1431
This commit is contained in:
parent
bc7e84677f
commit
788e6dc195
@ -45,13 +45,24 @@ public class ResponseSender {
|
||||
|
||||
public void send() throws IOException {
|
||||
setResponseHeaders();
|
||||
if ("bytes".equalsIgnoreCase(response.getHeaders().get("Accept-Ranges"))) {
|
||||
if ("HEAD".equals(exchange.getRequestMethod())) {
|
||||
sendHeadResponse();
|
||||
} else if ("bytes".equalsIgnoreCase(response.getHeaders().get("Accept-Ranges"))) {
|
||||
sendRawBytes();
|
||||
} else {
|
||||
sendCompressed();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendHeadResponse() throws IOException {
|
||||
try {
|
||||
exchange.getResponseHeaders().remove("Content-Length");
|
||||
beginSend();
|
||||
} finally {
|
||||
exchange.getRequestBody().close();
|
||||
}
|
||||
}
|
||||
|
||||
private void setResponseHeaders() {
|
||||
Headers headers = exchange.getResponseHeaders();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user