aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Köferli2013-04-15 10:21:09 (EDT)
committerStephan Leicht Vogt2013-04-15 15:17:46 (EDT)
commit754cb1082a2f927f4ee19aa3ec09d0a6bbd3e4af (patch)
tree5e4868dd255e039bc9a7c71fdc4192b0e39cd525
parenta4205fd5c2f58403ff9b9385d131cb5fc90889e6 (diff)
downloadorg.eclipse.scout.rt-754cb1082a2f927f4ee19aa3ec09d0a6bbd3e4af.zip
org.eclipse.scout.rt-754cb1082a2f927f4ee19aa3ec09d0a6bbd3e4af.tar.gz
org.eclipse.scout.rt-754cb1082a2f927f4ee19aa3ec09d0a6bbd3e4af.tar.bz2
Bug 401540 - JAX-WS: HTTP location change (301) for HTTP GET requests with a missing trailing slash failsrefs/changes/02/11902/3
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401540 Backwards compatibility with eclipse 3.4. Applies patch by Bruno Köferli. (cherry picked from commit 518f3a95b91b90452541582d0b1940e5aa422cfd) Change-Id: Ifcff984b3c431a2bf4b098a4c986249a591e45bb
-rw-r--r--org.eclipse.scout.jaxws216/src/org/eclipse/scout/jaxws/internal/JaxWsEndpointService.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.scout.jaxws216/src/org/eclipse/scout/jaxws/internal/JaxWsEndpointService.java b/org.eclipse.scout.jaxws216/src/org/eclipse/scout/jaxws/internal/JaxWsEndpointService.java
index 272f935..b3e0798 100644
--- a/org.eclipse.scout.jaxws216/src/org/eclipse/scout/jaxws/internal/JaxWsEndpointService.java
+++ b/org.eclipse.scout.jaxws216/src/org/eclipse/scout/jaxws/internal/JaxWsEndpointService.java
@@ -27,11 +27,11 @@ import javax.xml.ws.handler.Handler;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.URIUtil;
import org.eclipse.scout.commons.CompareUtility;
import org.eclipse.scout.commons.FileUtility;
import org.eclipse.scout.commons.IOUtility;
import org.eclipse.scout.commons.StringUtility;
+import org.eclipse.scout.commons.UriBuilder;
import org.eclipse.scout.commons.logger.IScoutLogger;
import org.eclipse.scout.commons.logger.ScoutLogManager;
import org.eclipse.scout.jaxws.Activator;
@@ -113,9 +113,13 @@ public class JaxWsEndpointService extends AbstractService implements IJaxWsEndpo
// ensure proper resource loading if trailing slash is missing
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
- final URI baseUri = URIUtil.fromString(JaxWsHelper.getBaseAddress(request, false));
- final IPath contextPath = new Path(request.getRequestURI()).addTrailingSeparator();
- response.setHeader("Location", URIUtil.append(baseUri, contextPath.toString()).toString());
+ final String baseUrl = JaxWsHelper.getBaseAddress(request, false);
+ IPath contextPath = new Path(request.getRequestURI()).addTrailingSeparator().makeAbsolute();
+ if (contextPath.isUNC()) {
+ contextPath = contextPath.makeUNC(false);
+ }
+ final URI redirectUri = new UriBuilder(baseUrl).path(contextPath.toString()).createURI();
+ response.setHeader("Location", redirectUri.toString());
return;
}