FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix issue #2096: Handle URLs with embedded HTTP credentials in _load_image by nMaroulis · Pull Request #2102 · abetlen/llama-cpp-python · GitHub

Fix issue #2096: Handle URLs with embedded HTTP credentials in _load_image - #2102

Open
nMaroulis wants to merge 1 commit into
abetlen:mainfrom
nMaroulis:main
Open

Fix issue #2096: Handle URLs with embedded HTTP credentials in _load_image#2102
nMaroulis wants to merge 1 commit into
abetlen:mainfrom
nMaroulis:main

Conversation

nMaroulis commented Dec 10, 2025
edited
Loading

Copy link
Copy Markdown

References:
Fixes Issue #2096

Overview:
Fixes an issue where _load_image fails on URLs containing HTTP credentials (e.g., http://user:pass@example.com/image.jpg) and raises http.client.InvalidURL.

Solution:

  • Detect URLs with embedded credentials.
  • Use HTTPPasswordMgrWithDefaultRealm + HTTPBasicAuthHandler from urllib.request.
  • Strip credentials from the URL before opening.
  • Imports remain inside the function to match library style.

Test plan:
Verified that _load_image now works with:

  • Normal URLs
  • URLs with embedded credentials
  • data: URLs

nMaroulis changed the title Handle URLs with embedded HTTP credentials in _load_image Fix issue #2096: Handle URLs with embedded HTTP credentials in _load_image Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL