Skip to content

Robustness against URLs that need redirect #11

@jmauersberger

Description

@jmauersberger

If I use a server base URL like GET: https://kpit.jamacloud.com/blafoobar/rest/v1/, the JamaClient.ping() method succeeds, because its actually only checks for errors (ApacheHttpClient:#120). However, in this case a 302 (redirect) is returned and all subsequent calls to the API fail with an exception:

java.lang.NullPointerException at java.io.StringReader.<init>(StringReader.java:50) at org.json.simple.parser.JSONParser.parse(JSONParser.java:79) at org.json.simple.parser.JSONParser.parse(JSONParser.java:75) at com.jamasoftware.services.restclient.json.SimpleJsonUtil.parseObject(SimpleJsonUtil.java:133)

Any idea how to make this more robust? Maybe the ping() evaluates the redirect and saves the redirected base URL? Or the client handles redirect calls on any get/put request (might be expensive).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions