Skip to content

Commit

Permalink
fix: Allow port 443 to be used with https (ollama provider) (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlebugorg authored Feb 4, 2025
1 parent a515d92 commit c9c0322
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/goose/src/providers/ollama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ impl OllamaProvider {
.map_err(|e| ProviderError::RequestFailed(format!("Invalid base URL: {e}")))?;

// Set the default port if missing
if base_url.port().is_none() {
let explicit_default_port = self.host.ends_with(":80") || self.host.ends_with(":443");
if base_url.port().is_none() && !explicit_default_port {
base_url.set_port(Some(OLLAMA_DEFAULT_PORT)).map_err(|_| {
ProviderError::RequestFailed("Failed to set default port".to_string())
})?;
Expand Down

0 comments on commit c9c0322

Please sign in to comment.