synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiranya Jayathilaka (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SYNAPSE-1008) Value setting though REST_URL_POSTFIX needs to be encoded
Date Fri, 27 May 2016 21:16:12 GMT

    [ https://issues.apache.org/jira/browse/SYNAPSE-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15304791#comment-15304791
] 

Hiranya Jayathilaka edited comment on SYNAPSE-1008 at 5/27/16 9:15 PM:
-----------------------------------------------------------------------

I don't like the idea of special casing REST_URL_POSTFIX in the property mediator. Also I
think it's fair to assume that a user might want any particular property value to be set as
as a URL encoded string. Therefore a more robust solution would be to provide a URL encoding
XPath function. Then the user can say:

{noformat}
<property name="REST_URL_POSTFIX" expression="url-encode('foo bar')" scope="axis2"/>
{noformat}

WDYT?


was (Author: hiranya):
I don't like the idea of special casing REST_URL_POSTFIX in the property mediator. Also I
think it's fair to assume that a user might want any particular property value to be set as
as a URL encoded string. Therefore a more robust solution would be to provide a URL encoding
XPath function. Then the user can say:

```
<property name="REST_URL_POSTFIX" expression="url-encode('foo bar')" scope="axis2"/>
```

WDYT?

> Value setting though REST_URL_POSTFIX needs to be encoded
> ---------------------------------------------------------
>
>                 Key: SYNAPSE-1008
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1008
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>            Reporter: Buddhima Wijeweera
>            Assignee: Hiranya Jayathilaka
>         Attachments: url_post-fix.diff
>
>
> REST_URL_POSTFIX value is added at the end of URL when sending request out of Synapse.
Currently if user sets a value with special characters (eg: space) it's not getting encoded.
But according to REC-3986 [1], URL needs to be encoded. With this fix;
> {noformat}
> <property name="REST_URL_POSTFIX" value="foo bar " scope="axis2"/>
> {noformat}
> will result,
> {noformat}
> GET /stockquote/foo%20bar%20 HTTP/1.1[\r][\n]
> {noformat}
> [1] [RFC 3986] Uniform Resource Identifier (URI): Generic Syntax - http://tools.ietf.org/html/rfc3986

> Thanks,
> Buddhima



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message