abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r599148 - in /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl: AbstractCollectionProvider.java AbstractWorkspaceProvider.java
Date Wed, 28 Nov 2007 21:13:33 GMT
Author: dandiep
Date: Wed Nov 28 13:13:32 2007
New Revision: 599148

URL: http://svn.apache.org/viewvc?rev=599148&view=rev
Log:
Ignore the query string when resolving URIs. Is there a better way to do this?

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionProvider.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractWorkspaceProvider.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionProvider.java?rev=599148&r1=599147&r2=599148&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionProvider.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionProvider.java
Wed Nov 28 13:13:32 2007
@@ -517,7 +517,17 @@
 
   @Override
   protected IRI resolveBase(RequestContext request) {
-    return request.getBaseUri().resolve(request.getUri());
+    IRI uri = request.getUri();
+    String q = uri.getQuery();
+    if (q != null && !"".equals(q)) {
+      String iriStr = uri.toString();
+      int idx = iriStr.indexOf('?');
+      uri = new IRI(iriStr.substring(0, idx));
+    }
+    
+    IRI resolved = request.getBaseUri().resolve(uri);
+    
+    return resolved;
   }
 
   public void begin(RequestContext request) throws ResponseContextException {

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractWorkspaceProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractWorkspaceProvider.java?rev=599148&r1=599147&r2=599148&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractWorkspaceProvider.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractWorkspaceProvider.java
Wed Nov 28 13:13:32 2007
@@ -129,11 +129,13 @@
           throw new ResponseContextException(404);
         }
         id = paths[0];
-      } else {    
-        wp = getWorkspaceInfo(paths[paths.length - 2]);
+      } else {
+        String workspaceId = paths[paths.length - 2];
+        workspaceId = Escaping.decode(workspaceId);
+        wp = getWorkspaceInfo(workspaceId);
         if (wp == null) {
           // TODO: 404
-          throw new RuntimeException();
+          throw new ResponseContextException(404);
         }
         id = paths[paths.length - 1];
       }



Mime
View raw message