cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1036004 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
Date Wed, 17 Nov 2010 12:40:35 GMT
Author: sergeyb
Date: Wed Nov 17 12:40:35 2010
New Revision: 1036004

URL: http://svn.apache.org/viewvc?rev=1036004&view=rev
Log:
Minor fix to do with handling trailing slashes for WADL queries working well

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java?rev=1036004&r1=1036003&r2=1036004&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
Wed Nov 17 12:40:35 2010
@@ -170,8 +170,8 @@ public class RequestPreprocessor {
     public Response checkMetadataRequest(Message m) {
         String query = (String)m.get(Message.QUERY_STRING);
         if (query != null && query.contains(WadlGenerator.WADL_QUERY)) {
-            String requestURI = (String)m.get(Message.REQUEST_URI);
-            String baseAddress = HttpUtils.getBaseAddress(m);
+            String requestURI = getValueWithoutSlash((String)m.get(Message.REQUEST_URI));
+            String baseAddress = getValueWithoutSlash(HttpUtils.getBaseAddress(m));
             if (baseAddress.equals(requestURI)) {
                 List<ProviderInfo<RequestHandler>> shs = ProviderFactory.getInstance(m).getRequestHandlers();
                 // this is actually being tested by ProviderFactory unit tests but just in
case
@@ -184,6 +184,10 @@ public class RequestPreprocessor {
         return null;
     }
     
+    private static String getValueWithoutSlash(String value) {
+        return value.endsWith("/") ? value.substring(0, value.length() - 1) : value;
+    }
+    
     public Response checkCodeRequest(Message m) {
         String query = (String)m.get(Message.QUERY_STRING);
         if (query != null && (query.contains(CodeGeneratorProvider.CODE_QUERY) 



Mime
View raw message