summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-http-runtime
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-23 23:37:26 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-08-23 23:37:26 +0000
commit5809f756cfa419554426a789974d76e01afe17e9 (patch)
tree8111651774f1dfcc2d9d592be6a4f3f113c7413a /sca-java-2.x/trunk/modules/binding-http-runtime
parentedf2b88c03f36f25510d79c1c617c77a873c7e30 (diff)
Test for null or empty servlet path info before redirecting to same URL with trailing /.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@988356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-http-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
index 0b49ed09e5..e2a3a5cf39 100644
--- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
+++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
@@ -75,13 +75,14 @@ public class HTTPBindingListenerServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
- String path = URLDecoder.decode(request.getPathInfo(), "UTF-8");
- if (path.length() ==0) {
+ String pathInfo = request.getPathInfo();
+ if (pathInfo == null || pathInfo.length() == 0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
return;
}
+ String path = URLDecoder.decode(pathInfo, "UTF-8");
// Invoke the get operation on the service implementation
Message requestMessage = messageFactory.createMessage();