Skip to content

Commit f63f1cf

Browse files
committed
Merge pull request briandilley#127 from lanxx019/fix_response
Only call servlet's getOutputStream right before we need to use it.
2 parents 277a19e + 6ed6d95 commit f63f1cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public JsonRpcServer(Object handler) {
7979
public void handle(ResourceRequest request, ResourceResponse response) throws IOException {
8080
logger.debug("Handing ResourceRequest {}", request.getMethod());
8181
response.setContentType(JSONRPC_CONTENT_TYPE);
82-
OutputStream output = response.getPortletOutputStream();
8382
InputStream input = getRequestStream(request);
83+
OutputStream output = response.getPortletOutputStream();
8484
handleRequest(input, output);
8585
// fix to not flush within handleRequest() but outside so http status code can be set
8686
output.flush();

0 commit comments

Comments
 (0)