]> source.dussan.org Git - sonarqube.git/commit
SONAR-10154 No streaming of web services response by default
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 29 Dec 2017 14:43:58 +0000 (15:43 +0100)
committerTeryk Bellahsene <teryk@users.noreply.github.com>
Wed, 3 Jan 2018 09:11:00 +0000 (10:11 +0100)
commit6a03f934fdd4d1f6700ff825d44e58a0d77c620d
treee012092d663be91fce42832dd9b384c5862d7a5c
parent134d7c42c8f494ef8297762e82c397ab8377b4ee
SONAR-10154 No streaming of web services response by default

- most of the WS rely on protobuf with one encapsulating object. In effect, streaming is useless in this case
- for WS relying on JsonWriter directly, if an exception was thrown when it has started writing, the WebServiceEngine error handling cannot work properly (clear response and format an error message with an appropriate HTTP response code)
- a new factory method is added to JsonWriter to have a non streamable JsonWriter. The response is effectively written when the JsonWriter is closed
server/sonar-server/src/main/java/org/sonar/server/ws/CacheWriter.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/ws/ServletResponse.java
server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java
server/sonar-server/src/test/java/org/sonar/server/ws/CacheWriterTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/ws/ServletResponseTest.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Response.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/text/JsonWriter.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java