Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpRequestImpl#connectTimeout does not support Fluent #5213

Closed
bennygao opened this issue May 27, 2024 · 2 comments
Closed

HttpRequestImpl#connectTimeout does not support Fluent #5213

bennygao opened this issue May 27, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@bennygao
Copy link

bennygao commented May 27, 2024

Questions

In implements code of io.vertx.ext.web.client.impl.HttpRequestImpl#connectTimeout, it is supposed to return this, but it returns null instead, causing a NullPointerException when setting other options of HttpRequest in a Fluent manner after connectTimeout.

    public HttpRequest<T> connectTimeout(long timeout) {
        this.connectTimeout = timeout;
        return null; // -> return this;
    }

For example:

webClient.requestAbs(method, absoluteURI)
        .connectTimeout(5000)
        .idleTimeout(60000) // NullPointerException here
	.putHeader("Content-Type", "application/json")
	.sendBuffer(buffer, asyncResult -> {
            ... ...
        });

Version

4.5.8

@bennygao bennygao added the bug label May 27, 2024
@vietj vietj added this to the 4.5.9 milestone May 27, 2024
@tsegismont tsegismont self-assigned this May 27, 2024
@tsegismont
Copy link
Contributor

Nice catch, thank you @bennygao !

@tsegismont
Copy link
Contributor

Fixed by vert-x3/vertx-web@c96962a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants