Fix issue 4444 by removing the request's context path when computing module-relative paths.
Patch by: Richard Zschech
Review by: bobv
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7459 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/rpc/server/RpcServlet.java b/user/src/com/google/gwt/rpc/server/RpcServlet.java
index 54f6205..04ce002 100644
--- a/user/src/com/google/gwt/rpc/server/RpcServlet.java
+++ b/user/src/com/google/gwt/rpc/server/RpcServlet.java
@@ -271,7 +271,12 @@
if (header == null) {
return null;
}
- return new URL(header).getPath();
+ String path = new URL(header).getPath();
+ String contextPath = getThreadLocalRequest().getContextPath();
+ if (!path.startsWith(contextPath)) {
+ return null;
+ }
+ return path.substring(contextPath.length());
} catch (MalformedURLException e) {
return null;
}