Project

General

Profile

Bug #1201

RecodePathFilterRequest state maintenance

Added by Dave Vieglais over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
d1_cn_service
Target version:
Start date:
2011-01-07
Due date:
% Done:

100%

Milestone:
Product Version:
*
Story Points:
Sprint:

Description

pathInfo is being set in the constructor for the RecodePathFilterRequest which is likely to be incorrect behavior since instances of this class are long-lived and so will likely handle multiple requests at different URLs.

This should probably (unless I misunderstand the intent of the filter) be refactored to retrieve the necessary information in the overridden getPathInfo() method.

Perhaps associated with this is to make use of the getContext() call to determine the context of the URL (referring to comment in source).

History

#1 Updated by Dave Vieglais over 13 years ago

oops. Correction - the filter is long lived, the request wrapper is of course created with each request.

Still - might be better to use getContextPath() and getServletPath() in place of hard coded strings?

#2 Updated by Rob Nahf over 13 years ago

  • Status changed from New to In Progress
  • Assignee set to Rob Nahf
  • Target version set to Sprint-2011.01

updated code to take advantage of getContext and getServletPath. Values for these methods (as well as getPathInfo) change between time of constructor and time of overridden getPathInfo, and is not currently working. For the curious, compare original vs. diagnostic values for pathInfo, context and servletpath:

from the constructor

Jan 7 12:14:50 cn-dev jsvc.exec[8332]: original pathInfo: null
Jan 7 12:14:50 cn-dev jsvc.exec[8332]: original requestURI: /cn/resolve/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ
Jan 7 12:14:50 cn-dev jsvc.exec[8332]: original ContextPath: /cn#012original ServletPath: /resolve/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ
Jan 7 12:14:50 cn-dev jsvc.exec[8332]: stripping /cn/resolve/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ from requestURI
Jan 7 12:14:50 cn-dev jsvc.exec[8332]: new pathinfo:

and from the getPathInfo() method

Jan 7 12:14:50 cn-dev jsvc.exec[8332]: diagnostic getPathInfo: null
#012diagnostic ContextPath: /cn
#012diagnostic ServletPath: /resolve/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ
Jan 7 12:14:50 cn-dev jsvc.exec[8332]: diagnostic getPathInfo: /resolve/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ
#012diagnostic ContextPath: /cn
#012diagnostic ServletPath: /metacat
#012CN Dispatching: /d1/meta/knb:testid:2011614101724_common-unicode-ascii-safe-ABCDEFGHIJKLMNOPQRSTUVWXYZ
#012HTTP Verb: GET

#3 Updated by Rob Nahf over 13 years ago

the situation on the cn seems to be different from the one on metacat:
1. the original PathInfo is null (so what's to replace & decode?)
2. the getServletPath() contains the PID, and a decoded version of the PID at that.

Not sure what to try next...

#4 Updated by Rob Nahf over 13 years ago

Logs show that parsing of requestURI is faulty, and even so, not being used by metacat.

Jan 7 13:01:48 cn-dev jsvc.exec[8332]: original pathInfo: null#012original requestURI: /cn/resolve/cn:testid:201171045\
15231:common-unicode-ascii-escape-anyway-%2B#012original ContextPath: /cn#012original ServletPath: /resolve/cn:testid:2\
0117104515231:common-unicode-ascii-escape-anyway-+#012stripping /cn/resolve/cn:testid:20117104515231:common-unicode-asc\
ii-escape-anyway-+ from requestURI#012new pathinfo: 2B
Jan 7 13:01:48 cn-dev jsvc.exec[8332]: diagnostic getPathInfo: null#012diagnostic ContextPath: /cn#012diagnostic Servl\
etPath: /resolve/cn:testid:20117104515231:common-unicode-ascii-escape-anyway-+
Jan 7 13:01:48 cn-dev jsvc.exec[8332]: diagnostic getPathInfo: /resolve/cn:testid:20117104515231:common-unicode-ascii-\
escape-anyway-%2B#012diagnostic ContextPath: /cn#012diagnostic ServletPath: /metacat
Jan 7 13:01:48 cn-dev jsvc.exec[8332]: CN Dispatching: /d1/meta/cn:testid:20117104515231:common-unicode-ascii-escape-a\
nyway-%2B#012HTTP Verb: GET#012handling verb 1 request with resource 'meta'#012resource: 'meta'#012resource_monitor: 'm\
onitor'#012sessionData: edu.ucsb.nceas.metacat.util.SessionData@5dcdd76a#012username: public#012sessionid: 0#012setting\
username to public.
Jan 7 13:01:48 cn-dev jsvc.exec[8332]: Using resource 'meta'
Jan 7 13:01:48 cn-dev jsvc.exec[8332]: org.dataone.service.exceptions.NotFound: Document not found:cn:testid:201171045\
15231:common-unicode-ascii-escape-anyway-%2B#012#011at edu.ucsb.nceas.metacat.dataone.CrudService.getSystemMetadata(Cru\
dService.java:1295)#012#011at edu.ucsb.nceas.metacat.restservice.ResourceHandler.getSystemMetadataObject(ResourceHandle\
r.java:1201)#012#011at edu.ucsb.nceas.metacat.restservice.ResourceHandler.handle(ResourceHandler.java:330)#012#011at ed\
u.ucsb.nceas.metacat.restservice.RestServlet.doGet(RestServlet.java:61)#012#011at javax.servlet.http.HttpServlet.servic\
e(HttpServlet.java:617)#012#011at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)#012#011at sun.reflect.Ge\
neratedMethodAccessor71.invoke(Unknown Source)#012#011at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth\
odAccessorImpl.java:25)#012#011at java.lang.reflect.Method.invoke(Method.java:597)#012#011at org.apache.catalina.securi\
ty.SecurityUtil$1.run(SecurityUtil.java:269)#012#011at java.security.AccessController.doPrivileged(Native Method)#012#0\
11at javax.security.auth.Subject.doAsPrivileged(Subject.java:517

#5 Updated by Rob Nahf over 13 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

needed to put the decode into proxy.ObjectController.getRequestGUID() method instead of as a filter - that's where the servlet forwarding was being accomplished. Installed changes on cn-dev, and all but one test passed (escaped-;). That is a separate issue, so will close this item out.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)