Giter VIP home page Giter VIP logo

Comments (3)

scottslewis avatar scottslewis commented on July 17, 2024

Hi. I'm still looking into this. Apparently the behavior of WebTarget.queryParam (which is what is used by ECF proxy impl at runtime to handle the QueryParam annotations on client side) is implementation-dependent. In this case currently Jersey 2.30.1)...and it seems that the encoding might not be done correctly:

https://linuxtut.com/en/ee817c1e792adcd07e5d/

I'm still tracking down whether this is true specifically for Jersey 2.30.1. If the above is still true for this version of Jersey, then you might try doing as they suggest...i.e. manually encoding/decoding to handle the % (which should be url encoded as %25 I think).

Unfortunately, since Jersey is doing the real work here, I can't fix this problem. I might be able to impose a work-around (doing this encoding specifically for % only) if it does turn out to still be Jersey's behavior...but before doing that I want to understand better what Jersey is doing. Could you please try encoding the % chars as %25 manually before call and report what happens here? Thanks.

from jaxrsproviders.

nagelfargithub avatar nagelfargithub commented on July 17, 2024

Yes, I can confirm this is exactly what we are seeing, %cargo breaks as c and a are hex, %reis works as r is not hex.
I tried manually encoding % to %25 and it works so I understand this is not a bug, let alone in your implementation but works as "expected". We'll look into using a Filter (or similar) to do this on a default level. Thanks for your feedback!

from jaxrsproviders.

scottslewis avatar scottslewis commented on July 17, 2024

Ok, thanks for checking and reporting here. FWIW, the JaxRSProvider allows you to use OSGI services to setup a javax.ws.rs.client.ClientRequestFilter implementation. As an example, see this bundle:

https://github.com/ECF/JaxRSProviders/tree/master/examples/org.eclipse.ecf.example.jersey.client.basicauth

This creates a ClientRequestFilter to pass basic auth data along with the request. Note from the src here:

https://github.com/ECF/JaxRSProviders/blob/master/examples/org.eclipse.ecf.example.jersey.client.basicauth/src/org/eclipse/ecf/example/jersey/client/basicauth/BasicAuthClientRequestFilter.java

this annotation:

@component(immediate=true,property = {"jaxrs-service-exported-config-target=ecf.jaxrs.jersey.client" })

defines this as an declarative services Component. The property = {"jaxrs-service-exported-config-target=ecf.jaxrs.jersey.client" } definition allows you to target a specific config name for your filter. Yours should be similar...i.e. "ecf.jaxrs.jersey.client". As long as this Component is registered before importing the remote service (e.g. on starup), the Component with the property will be registered to the client as a ClientRequestFilter and filter method will be called every time request/method call is made. I think that you can then used the ClientRequestContext.getParameterMap() to get the relevant parameter value, url encode any % and then put the new value in the parameter map.

from jaxrsproviders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.