You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ripple.apache.org by Marcos Lin <ma...@farport.co.uk> on 2013/12/11 12:05:15 UTC

Ripple Proxy Hangs with Content Type "application/json;charset=UTF-8"

Hi,

I am testing "incubator-ripple" project and found a problem with
proxy.js as it does not recognises "application/json;charset=UTF-8"
content-type.

Here is a quick fix that I made on proxy.js:89

    if (Object.keys(req.body).length > 0) {
            var content_type = req.get("content-type"),
                json_mimetype = "application/json";

            if (content_type.slice(0, json_mimetype.length)===json_mimetype) {
                proxyReqData.body = JSON.stringify(req.body);
            } else {
                proxyReqData.form = req.body;
            }
     }

Can this be fixed in the repo?  I am happy to contribute if I knew how.

Thanks,

Marcos Lin

Re: Ripple Proxy Hangs with Content Type "application/json;charset=UTF-8"

Posted by JR <jr...@gmail.com>.
Hi Marcos,

You have to sign the Apache agreement here:
http://www.apache.org/licenses/icla.txt then fax or scan/email it in. Once
that's done you can submit a pull request here:
https://github.com/apache/incubator-ripple/pulls

Thanks for contributing!
-Jonathan


On Wed, Dec 11, 2013 at 6:05 AM, Marcos Lin <ma...@farport.co.uk>wrote:

> Hi,
>
> I am testing "incubator-ripple" project and found a problem with
> proxy.js as it does not recognises "application/json;charset=UTF-8"
> content-type.
>
> Here is a quick fix that I made on proxy.js:89
>
>     if (Object.keys(req.body).length > 0) {
>             var content_type = req.get("content-type"),
>                 json_mimetype = "application/json";
>
>             if (content_type.slice(0,
> json_mimetype.length)===json_mimetype) {
>                 proxyReqData.body = JSON.stringify(req.body);
>             } else {
>                 proxyReqData.form = req.body;
>             }
>      }
>
> Can this be fixed in the repo?  I am happy to contribute if I knew how.
>
> Thanks,
>
> Marcos Lin
>



-- 
Jonathan