You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@knox.apache.org by larry mccay <la...@gmail.com> on 2015/03/20 15:58:37 UTC

Re: Does Knox do URL encoding of PUT/POST content?

Hi Dimple -

I don't recall hearing of anyone with an issue like this - I think that in
order to help you that I will need a bit more information:

1. What are the APIs that you have going through Knox and routing service
are you using to do this with?
2. Knox doesn't typically do redirection to webapps. Perhaps you don't mean
redirection? This would imply that Knox is redirecting the browser/client
to go direct to your webapp rather than having all requests go through the
gateway. Do you have APIs in your app that redirect requests to other URLs
in your app?
3. Ambari is also generally deployed alongside of Knox and we don't
currently have a routing service for its APIs yet - are you proxying access
to Ambari through Knox now?
4. We do have to do some encoding and we actually protect the original URL
through encryption. This may account for the '=' that you are seeing - a
BASE64 encoding of the encrypted bytes. This would be removed in the second
trip through Knox in the event of a redirect back through the gateway.

Hopefully, with a better sense of what your deployment scenario is, we can
help.

thanks,

--larry

On Fri, Mar 20, 2015 at 12:40 AM, Dimp Bhat <di...@gmail.com> wrote:

> Hi,
> We have a custom web application running on Ambari running behind Knox, and
> we've noticed that our web application is failing for PUT and POST calls.
> We've determined that, when Knox does the redirection to our web
> application, it seems to be URL-encoding the PUT/POST content, which is
> breaking our application.  For example, instead of getting:
>
> {"g2t-request-content-params":{"clear-cache":"true"},"g2t-request-content-body":null}
> we see :
>
> %7B%22g2t-request-content-params%22%3A%7B%22clear-cache%22%3A%22true%22%7D%2C%22g2t-request-content-body%22%3Anull%7D=
>
> And also '=' at the end..when we tried to decode the request body in the
> java side, we still see an '=' at the end...
>
> Has anyone encountered this issue? Pls advise on any workarounds/fixes.
> Thanks
>
> Dimple
>