StarRocks / starrocks-connector-for-apache-spark

Apache License 2.0
36 stars 53 forks source link

Bugfix: use preemptive basic authentication to avoid useless http request without authentication #2

Closed wyb closed 2 years ago

wyb commented 2 years ago

fix #1

By default, httpclient will not provide credentials preemptively, it will first create a HTTP request without authentication parameters. This is by design, as a security precaution, and as part of the spec.

But it causes extra latency to a request, as you need to make multiple calls, and causes errors to appear in the logs.

So we can use the preemptive basic authentication to avoid useless http request without authentication.