Merge pull request #151 from ollama4j/docs-updates
All checks were successful
Mark stale issues / stale (push) Successful in 32s

This commit is contained in:
Amith Koujalgi 2025-08-31 23:47:30 +05:30 committed by GitHub
commit 0e0c83a065
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@ Find more details on the [website](https://ollama4j.github.io/ollama4j/).
[![Run Unit and Integration Tests](https://github.com/ollama4j/ollama4j/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ollama4j/ollama4j/actions/workflows/run-tests.yml)
![Build Status](https://github.com/ollama4j/ollama4j/actions/workflows/maven-publish.yml/badge.svg)
![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/ollama4j_ollama4j?server=https%3A%2F%2Fsonarcloud.io&label=Sonar%20Quality%20Gate)
</div>

View File

@ -1643,18 +1643,18 @@ public class OllamaAPI {
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri)
.header(Constants.HttpConstants.HEADER_KEY_CONTENT_TYPE, Constants.HttpConstants.APPLICATION_JSON)
.timeout(Duration.ofSeconds(requestTimeoutSeconds));
if (isBasicAuthCredentialsSet()) {
if (isAuthSet()) {
requestBuilder.header("Authorization", auth.getAuthHeaderValue());
}
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;
}