You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Marko Herchet (JIRA)" <ji...@apache.org> on 2017/08/15 12:07:00 UTC

[jira] [Created] (OLINGO-1163) Unreliable parsing of rawODataPath in ODataHttpHandlerImpl

Marko Herchet created OLINGO-1163:
-------------------------------------

             Summary: Unreliable parsing of rawODataPath in ODataHttpHandlerImpl
                 Key: OLINGO-1163
                 URL: https://issues.apache.org/jira/browse/OLINGO-1163
             Project: Olingo
          Issue Type: Bug
          Components: odata4-server
    Affects Versions: (Java) V4 4.0.0
         Environment: Win10
Wildfly10
            Reporter: Marko Herchet


In org.apache.olingo.server.core.ODataHttpHandlerImpl#fillUriInformation the rawODataPath is parsed as can be seen in the following code.

{code:java}
  static void fillUriInformation(final ODataRequest odRequest, final HttpServletRequest httpRequest, final int split) {
    String rawRequestUri = httpRequest.getRequestURL().toString();

    String rawODataPath;
    if (!"".equals(httpRequest.getServletPath())) {
      int beginIndex = rawRequestUri.indexOf(httpRequest.getServletPath()) + httpRequest.getServletPath().length();
      rawODataPath = rawRequestUri.substring(beginIndex);
    }
{code}

In my scenario 
"httpRequest.getRequestURL().toString()" returns "http://odata.test.de/wf/odata/$metadata" and 
"httpRequest.getServletPath()" returns "/odata"
which wrongly leads to a rawODataPath of ".test.de/wf/odata/$metadata".




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)