Changeset 218
- Timestamp:
- 03/08/10 16:25:36 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/rest/VirtualCollectionRegistryRestService.java
r217 r218 57 57 Principal principal = security.getUserPrincipal(); 58 58 if (principal == null) { 59 throw new NullPointerException("princial == null"); 59 String path = uriInfo.getPath(); 60 if (path.endsWith("/")) { 61 /* 62 * fix bad client request and remove tailing slash 63 */ 64 path = path.substring(0, path.length() - 1); 65 URI uri = uriInfo.getBaseUriBuilder().path(path).build(); 66 return Response.temporaryRedirect(uri).build(); 67 } 68 /* 69 * should never happen, because servlet container should 70 * supply a valid principal 71 */ 72 throw new AssertionError("prinicial == null"); 60 73 } 61 74 try { … … 162 175 Principal principal = security.getUserPrincipal(); 163 176 if (principal == null) { 164 throw new NullPointerException("princial == null"); 177 String path = uriInfo.getPath(); 178 if (path.endsWith("/")) { 179 /* 180 * fix bad client request and remove tailing slash 181 */ 182 path = path.substring(0, path.length() - 1); 183 URI uri = uriInfo.getBaseUriBuilder().path(path).build(); 184 return Response.seeOther(uri).build(); 185 } 186 /* 187 * should never happen, because servlet container should 188 * supply a valid principal 189 */ 190 throw new AssertionError("prinicial == null"); 165 191 } 166 192 final VirtualCollectionList vcs =
Note: See TracChangeset
for help on using the changeset viewer.