Code Monkey home page Code Monkey logo

king-http-client's People

Contributors

aghiuru avatar bysse avatar erikbystrom avatar gpunti avatar greg-chrystall avatar hrhdreas avatar magnus-gustafsson avatar mangelero avatar oriolbellet avatar rickard-von-essen avatar sebastienblanc avatar svetaandriyanchik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

king-http-client's Issues

Follow relative redirects fails

When handling a redirect response that has a relative location,

httpRedirector.redirectRequest(httpRequestContext, httpHeaders);

we try to build the new URL with ServerInfo.buildFromUri

ServerInfo redirectServerInfo = ServerInfo.buildFromUri(redirectLocation);

which fails with a relative location (e.x.: /foo)

if (uriString.startsWith("http:") || uriString.startsWith("https:") || uriString.startsWith("ws:") || uriString.startsWith("wss:")) {

We should either: Have a better error that relative URIs are not supported to follow redirects, or make the redirect enrich the URI with the absolute part of the HttpRequestContext

Weird timeout behaviour

Brief description:
After "connecting" to the BackEnd the idle-timeout seems to cause the connection to crash - which should probably not happen. I have also tried to set the idleTimeoutMills and totalRequestTimeoutMills to higher values like 10000 ms - same issue.

Reproducability:

Version 3.0.18
Code:

SseClient sseClient= httpClient.createSSE("https://datagate.dev:6040/api/v1/events")
                .addHeader("Authorization", "Bearer " + APIConnection.token)
                .build()
                .execute(new SseClientCallback() {
            @Override
            public void onConnect() {
                logger.info("Connected to the SSE-Backend!");
            }

            @Override
            public void onDisconnect() {
                logger.info("Disconnected from the SSE-Backend!");
            }

            @Override
            public void onError(Throwable throwable) {
                logger.error("SSE-Error: " + throwable.toString());
                throwable.printStackTrace();
            }
}

Error:
23:26:18.908 [HttpClient-HttpCallback 2] INFO d.d.api.rest.sse.EventHandler - Connected to the SSE-Backend!
23:26:19.986 [HttpClient-HttpCallback 1] ERROR d.d.api.rest.sse.EventHandler - SSE-Error: com.king.platform.net.http.netty.TimeoutException: Idle timeout of 1000 ms was 1077 ms since last event
com.king.platform.net.http.netty.TimeoutException: Idle timeout of 1000 ms was 1077 ms since last event
at com.king.platform.net.http.netty.IdleTimeoutTimerTask.run(IdleTimeoutTimerTask.java:66)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:682)
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:757)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:485)
at java.lang.Thread.run(Thread.java:748)

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.