You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Holzer (JIRA)" <ji...@apache.org> on 2015/02/20 14:04:11 UTC
[jira] [Commented] (OLINGO-577) Invalid escaping of space
characters
[ https://issues.apache.org/jira/browse/OLINGO-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14328885#comment-14328885 ]
Christian Holzer commented on OLINGO-577:
-----------------------------------------
I made a fix for this issue
> Invalid escaping of space characters
> ------------------------------------
>
> Key: OLINGO-577
> URL: https://issues.apache.org/jira/browse/OLINGO-577
> Project: Olingo
> Issue Type: Bug
> Components: odata4-client
> Affects Versions: (Java) V4 4.0.0-beta-03
> Reporter: Christian Holzer
> Priority: Minor
> Attachments: Olingo577.diff
>
>
> Hi,
> I've noticed an issue while building of URIs with the OData Client. I used the following snipped:
> final ODataClient client = getClient();
> final String filter = client.getFilterFactory().eq(
> client.getFilterFactory().getArgFactory().property("PropertyString"),
> client.getFilterFactory().getArgFactory().literal("First Resource - positive values")).build();
> final URI uri = client.newURIBuilder(SERVICE_URI)
> .appendEntitySetSegment(ES_ALL_PRIM)
> .filter(filter)
> .build();
> final ODataRetrieveResponse<ODataEntitySet> response = client.getRetrieveRequestFactory()
> .getEntitySetRequest(uri).execute();
> The request has the uses the following URI:
> /odata-server-tecsvc/odata.svc/ESAllPrim?%24filter=%28PropertyString+eq+%27First+Resource+-+positive+values%27%29
> In OData Version 4.0 Part 2: URL Conventions Plus Errata 02 is mentioned that OData follows RFC 3986 and uses percent-decoding exactly ones. RFC 3986 says “A percent-encoding mechanism is used to represent a data octet in a component when that octet's corresponding character is outside the allowed set…” The allowed set in the query component is described as
> query = *( pchar / "/" / "?" )
> pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
> unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
> pct-encoded = "%" HEXDIG HEXDIG
> sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
> / "*" / "+" / "," / ";" / "="
> So up the this rules the space character has to be encoded as %20 instead of +.
> Kind regards
> Christian
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)