Skip to content

Commit e4142e9

Browse files
committed
fix(ollamaManager): trim trailing slashes from Ollama hostname URL
1 parent 2b8f616 commit e4142e9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ollamaManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import console from "console"
21
import { Ollama } from "ollama"
32
import { window, workspace } from "vscode"
43

@@ -23,7 +22,7 @@ export class OllamaManager {
2322

2423
try {
2524
const newHost = new URL(inputHostname)
26-
hostname = newHost.toString()
25+
hostname = newHost.toString().replace(/\/+$/, "")
2726
} catch (error) {
2827
window.showErrorMessage("Invalid hostname URL. Please enter a valid URL (eg http://localhost:11434).")
2928
return this.ollamaModelConfig(includeHostnameSelection)

0 commit comments

Comments
 (0)