aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2017-12-29 15:54:59 +0100
committerTeryk Bellahsene <teryk@users.noreply.github.com>2018-01-03 10:11:00 +0100
commitb84b2196e575c1917757e2d03c025b9ab305b171 (patch)
treed30fd25878708f8d33ac171c90872283872066d3 /server
parent6a03f934fdd4d1f6700ff825d44e58a0d77c620d (diff)
downloadsonarqube-b84b2196e575c1917757e2d03c025b9ab305b171.tar.gz
sonarqube-b84b2196e575c1917757e2d03c025b9ab305b171.zip
SONAR-10154 Do not reset WS response if it is streamed
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
index 8455de88e13..01bbac4685c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
@@ -132,6 +132,10 @@ public class WebServiceEngine implements LocalConnector, Startable {
private static void sendErrors(Response response, int status, List<String> errors) {
Response.Stream stream = response.stream();
if (stream instanceof ServletResponse.ServletStream) {
+ if (((ServletResponse.ServletStream) stream).response().isCommitted()) {
+ // streaming of response. It's no more possible to clear and reformat the response
+ return;
+ }
((ServletResponse.ServletStream) stream).reset();
}
stream.setStatus(status);