Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2015-04-28 14:19:25 +0000
committerThomas Watson2015-04-28 14:32:50 +0000
commit1a9af5de5f0d30949ed68242361e8dc0c339213b (patch)
tree860ec988376956100d00c91c792faecce59d63be
parentb234ac03f6d282648cb05586821847c5ed15b4e6 (diff)
downloadrt.equinox.bundles-1a9af5de5f0d30949ed68242361e8dc0c339213b.tar.gz
rt.equinox.bundles-1a9af5de5f0d30949ed68242361e8dc0c339213b.tar.xz
rt.equinox.bundles-1a9af5de5f0d30949ed68242361e8dc0c339213b.zip
Bug 465445 - ContextServiceTest#testRemoteContextNotFound() fails since
I20150422-1000 - Ensure sendError is sent even if response has been committed
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
index 0bf19daf0..f607a2420 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ResponseStateHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Raymond Augé and others.
+ * Copyright (c) 2014, 2015 Raymond Augé and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -221,9 +221,14 @@ public class ResponseStateHandler {
HttpServletResponse wrappedResponse = (HttpServletResponse)wrapperImpl.getResponse();
- if (wrappedResponse.isCommitted() || (wrapperImpl.getStatus() == -1)) {
- // There's nothing we can do here.
-
+ if (status == -1) {
+ // There's nothing more we can do here.
+ return;
+ }
+ if (wrappedResponse.isCommitted()) {
+ // the response is committed already, but we need to propagate the error code anyway
+ wrappedResponse.sendError(status, wrapperImpl.getMessage());
+ // There's nothing more we can do here.
return;
}

Back to the top