[PR #61] [CLOSED] Fixes URL parsing when basic auth is included in the URL. #347

Closed
opened 2026-02-15 16:30:04 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama-python/pull/61
Author: @lemeur
Created: 2/12/2024
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • d27b72a Fixes URL parsing when basic auth is included in the URL.

📊 Changes

1 file changed (+5 additions, -3 deletions)

View changed files

📝 ollama/_client.py (+5 -3)

📄 Description

Ollama may be protected by a reverse proxy enforcing basic auth.

When the Ollama URL contains basic auth elements, ollama-python removed them from the URL leading in a HTTP 401 ERROR.

from ollama import Client
client = Client(host='http://<username>:<password>@<ip>:<port>/')

This patch fixes the parsing of the URL so that basic auth elements are not removed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama-python/pull/61 **Author:** [@lemeur](https://github.com/lemeur) **Created:** 2/12/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`d27b72a`](https://github.com/ollama/ollama-python/commit/d27b72a82db0c52b52500137c3b035bc6ea75019) Fixes URL parsing when basic auth is included in the URL. ### 📊 Changes **1 file changed** (+5 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `ollama/_client.py` (+5 -3) </details> ### 📄 Description Ollama may be protected by a reverse proxy enforcing basic auth. When the Ollama URL contains basic auth elements, ollama-python removed them from the URL leading in a HTTP 401 ERROR. ``` from ollama import Client client = Client(host='http://<username>:<password>@<ip>:<port>/') ``` This patch fixes the parsing of the URL so that basic auth elements are not removed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 16:30:04 -05:00
yindo closed this issue 2026-02-15 16:30:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#347