aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
index d2f0cd2731..bf3da4b5d0 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
@@ -255,9 +255,11 @@ public class GitSmartHttpTools {
private static void send(HttpServletRequest req, HttpServletResponse res,
String type, byte[] buf, int httpStatus) throws IOException {
ServletUtils.consumeRequestBody(req);
- res.setStatus(httpStatus);
- res.setContentType(type);
- res.setContentLength(buf.length);
+ if (!res.isCommitted()) {
+ res.setStatus(httpStatus);
+ res.setContentType(type);
+ res.setContentLength(buf.length);
+ }
try (OutputStream os = res.getOutputStream()) {
os.write(buf);
}