You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Svetoslav Neykov (JIRA)" <ji...@apache.org> on 2017/02/14 16:10:42 UTC

[jira] [Updated] (BROOKLYN-437) Deprecate Url.{encode,decode} and other uses of URLEncoder

     [ https://issues.apache.org/jira/browse/BROOKLYN-437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Svetoslav Neykov updated BROOKLYN-437:
--------------------------------------
    Description: 
{{URLEncoder}} is used for encoding the data in the body of a POST request. While close to the encoding of parameters in the URL query part it's not the same. It's used for encoding other parts of the URL as well like the username/password pair or path elements. While this works fine in testing scenarios and straightforward usage it will fail in some edge cases, leading to hard to troubleshoot intermittent errors.

I suggest we replace it with a URL builder instead where it's possible to express which part of the URL needs escaping.
One possible option is https://github.com/mikaelhg/urlbuilder. It's standalone with minimal dependencies. Suggest going through the test coverage before deciding on it though.
There are other alternative implementations, usually bundles with jax-rs implementations which makes them much more heavy. Could already have one coming from CXF - needs checking.

See https://github.com/apache/brooklyn-server/pull/551 for discussion details.

  was:
{{URLEncoder}} is used for encoding the data in the body of a POST request. While close to the encoding of parameters in the URL query part it's not the same. It's used for encoding other parts of the URL as well like the username/password pair or path elements. While this works fine in testing scenarios and straightforward usage it will fail in some edge cases, leading to hard to troubleshoot intermittent errors.

I suggest we replace it with a URL builder instead where it's possible to express which part of the URL needs escaping.
One possible option is https://github.com/mikaelhg/urlbuilder. It's standalone with minimal dependencies. Suggest going through the test coverage before deciding on it though.
There are other alternative implementations, usually bundles with jax-rs implementations which makes them much more heavy. Could already have one coming from CXF - needs checking.


> Deprecate Url.{encode,decode} and other uses of URLEncoder
> ----------------------------------------------------------
>
>                 Key: BROOKLYN-437
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-437
>             Project: Brooklyn
>          Issue Type: Improvement
>            Reporter: Svetoslav Neykov
>
> {{URLEncoder}} is used for encoding the data in the body of a POST request. While close to the encoding of parameters in the URL query part it's not the same. It's used for encoding other parts of the URL as well like the username/password pair or path elements. While this works fine in testing scenarios and straightforward usage it will fail in some edge cases, leading to hard to troubleshoot intermittent errors.
> I suggest we replace it with a URL builder instead where it's possible to express which part of the URL needs escaping.
> One possible option is https://github.com/mikaelhg/urlbuilder. It's standalone with minimal dependencies. Suggest going through the test coverage before deciding on it though.
> There are other alternative implementations, usually bundles with jax-rs implementations which makes them much more heavy. Could already have one coming from CXF - needs checking.
> See https://github.com/apache/brooklyn-server/pull/551 for discussion details.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)