[
https://issues.apache.org/jira/browse/OLINGO-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend resolved OLINGO-577.
------------------------------------
Resolution: Fixed
Fix Version/s: (Java) V4 4.0.0-beta-03
Assignee: Christian Amend
Fixed with commit:
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=cfb72decd1ff79d5f9b8b968ee03dd1ad22f33e4
Thank you for your patch.
> 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
> Assignee: Christian Amend
> Priority: Minor
> Fix For: (Java) V4 4.0.0-beta-03
>
> Attachments: Olingo577-002.diff, 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)