]> source.dussan.org Git - jgit.git/commitdiff
Fix ObjectUploadListener#close 82/129582/1
authorMatthias Sohn <matthias.sohn@sap.com>
Mon, 17 Sep 2018 23:14:34 +0000 (01:14 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 17 Sep 2018 23:29:58 +0000 (01:29 +0200)
Do not try to set response status if response is already committed.

Change-Id: I9a7c2871c86eb53416b905324775f3ed961c8ae6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java

index 84e4e6f1c662da7a283d823990bd434c948ab794..da86880472b47038e429a3407d341094b652628d 100644 (file)
@@ -150,7 +150,9 @@ public class ObjectUploadListener implements ReadListener {
                        channel.close();
                        // TODO check if status 200 is ok for PUT request, HTTP foresees 204
                        // for successful PUT without response body
-                       response.setStatus(HttpServletResponse.SC_OK);
+                       if (!response.isCommitted()) {
+                               response.setStatus(HttpServletResponse.SC_OK);
+                       }
                } finally {
                        context.complete();
                }