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

validateProxyResponse only check status code and version #63

Open
isabelge opened this issue Dec 3, 2024 · 0 comments
Open

validateProxyResponse only check status code and version #63

isabelge opened this issue Dec 3, 2024 · 0 comments

Comments

@isabelge
Copy link

isabelge commented Dec 3, 2024

Would it be possible to validate the proxy response with the status code and the version?
Some proxy response with connected and not connection established and in that case the validation false.
If it could be changed to something like this, it would also work for proxies with a different response.

@Override
public boolean validateProxyResponse(ProxyResponse response) {
    Objects.requireNonNull(response, "'response' cannot be null.");


    final HttpStatusLine status = response.getStatus();
    if (status == null) {
        logger.error("Response does not contain a status line. {}", response);
        return false;
    }

    return status.getStatusCode() == 200 && SUPPORTED_VERSIONS.contains(status.getProtocolVersion());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant