Hi,
I need to pass some encoded strings as part of my URL (ex: /users/user/cn%3Dphilippe riand%2Fo%3Dtrilog) but, as far as I tried, all of the Java servlet methods return the URL as partially decoded (/users/user/cn=philippe%20riand/o=trilog). Because the ‘/’ is being decoded, we cannot know what is an actual parameter separator or part of the value.
Is there a way to get the ‘raw’, undecoded URL, by accessing a CGI variable or whatever. Part of our code is native “C”, so we can call a “C” function if necessary.
Phil.
Subject: Some info
I’m not familiar with this area of the product, but I did find what appears to be a very similar SPR from the 8.5.2 timeframe. Here are the details on that case:
When using a url that contains encoded / in a segment, the encoded / is wrongly decoded by getRequestURI, causing behaviour problem in ISV API
Steps to reproduce:
use the following url from a browser: http://localhost/sample.nsf/api/data/documents/form/test%2Fform http://localhost/sample.nsf/api/data/documents/form/test%2Fform atom+xml $B>.Ln(B $B=<(B/
In the http request, the url is encoded as : http://localhost/sample.nsf/api/data/documents/form/test%2Fform%20atom+xml%20小野%20充/ http://localhost/sample.nsf/api/data/documents/form/test%2Fform%20atom+xml%20小野%20充/
In the Domino Web Container, get RequestURI() returns: http://localhost/sample.nsf/api/data/documents/form/test/form http://localhost/sample.nsf/api/data/documents/form/test/form atom+xml $B>.Ln(B $B=<(B/
In one segment of the url, we use a form name called test/form atom+xml $B>.Ln(B $B=<(B. Notice that the %2F which is part of a segment of the original url is transformed in /, causing the ISV Api to not find the form name.
According to the servlet api spec: the following function should not be decoded by the webcontainer:
getRequestURI
getContextPath()
getQueryString()
The SPR is DTAB82LPFP, and it was fixed in 8.5.2. Assuming this is related to the issue you are reporting, it would seem the fix doesn’t cover all cases, and we’d need to open a PMR to take a look. I didn’t see any other ways to get the raw string, and since the behavior violated the specification, I would think there isn’t another way outside of those standard APIs.
Subject: Raw uri
Could try asking for the following cgi var
“DOCUMENT_URI=”
This appears to be set to the raw uri
Subject: I found the culprit…
Right, this is very similar. Actually this is not a Domino issue, but an IBM SBT SDK one. My request is going through the proxy component and that improperly decodes the url. I submitted an issue to the SBT team: Issue with the proxy · Issue #1704 · OpenNTF/SocialSDK · GitHub https://github.com/OpenNTF/SocialSDK/issues/1704
Thanks for your reply!