Skip to content

Commit 2a1880f

Browse files
authored
feat: do not send origin header to ollama
Currently the request to Ollama contains `Origin: null` header, which is not accepted by Ollama server (server responds with 403). There seem to be a way to remove Origin header, by setting it's value to an empty string. fixes: - gitbutlerapp#8078 - gitbutlerapp#5862 ref: - tauri-apps/plugins-workspace#1941 - https://github.com/ollama/ollama-js/blob/6a4bfe3ab033f611639dfe4249bdd6b9b19c7256/src/browser.ts#L38 - https://github.com/gitbutlerapp/gitbutler/blob/9af0e4bbaa845aeb40a82f22ad66975a61990654/Cargo.lock#L8431
1 parent 9af0e4b commit 2a1880f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/desktop/src/lib/ai/ollamaClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ export class OllamaClient implements AIClient {
5353
private modelName: string
5454
) {
5555
this.ollama = new Ollama({
56-
host: this.endpoint
56+
host: this.endpoint,
57+
headers: {
58+
origin: ''
59+
}
5760
});
5861
}
5962

0 commit comments

Comments
 (0)