mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-09-16 03:39:05 +02:00
Update OllamaAPI.java
This commit is contained in:
parent
a3ebe6c992
commit
a093be5581
@ -1643,18 +1643,18 @@ public class OllamaAPI {
|
|||||||
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri)
|
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri)
|
||||||
.header(Constants.HttpConstants.HEADER_KEY_CONTENT_TYPE, Constants.HttpConstants.APPLICATION_JSON)
|
.header(Constants.HttpConstants.HEADER_KEY_CONTENT_TYPE, Constants.HttpConstants.APPLICATION_JSON)
|
||||||
.timeout(Duration.ofSeconds(requestTimeoutSeconds));
|
.timeout(Duration.ofSeconds(requestTimeoutSeconds));
|
||||||
if (isBasicAuthCredentialsSet()) {
|
if (isAuthSet()) {
|
||||||
requestBuilder.header("Authorization", auth.getAuthHeaderValue());
|
requestBuilder.header("Authorization", auth.getAuthHeaderValue());
|
||||||
}
|
}
|
||||||
return requestBuilder;
|
return requestBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if Basic Auth credentials set.
|
* Check if auth param is set.
|
||||||
*
|
*
|
||||||
* @return true when Basic Auth credentials set
|
* @return true when auth param is set
|
||||||
*/
|
*/
|
||||||
private boolean isBasicAuthCredentialsSet() {
|
private boolean isAuthSet() {
|
||||||
return auth != null;
|
return auth != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user