Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix host breaking when set to only port #116

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

thinkverse
Copy link
Contributor

@thinkverse thinkverse commented Jul 19, 2024

I noticed that setting the host to only a port - see example below, would break the formatting and return a jumbled host http://http:11434//127.0.0.1:11434. I confirmed this is an issue on both Node and Deno, see attached images.

const ollama = new Ollama({ host: ":11434" });
Screenshot 2024-07-19 at 22 44 42 Screenshot 2024-07-19 at 22 45 12

Wrote a quick test for the formatted and tested 19 different variants - see attached image, which confirmed the issue was only present when passing in a port to formatHost.

Screenshot 2024-07-19 at 22 47 41

Setting isExplicitProtocol to true instead of false fixes this issue.

Screenshot 2024-07-19 at 22 50 22

@thinkverse thinkverse force-pushed the fix-host-formatting-for-port branch from bfb0712 to 0138b82 Compare July 21, 2024 03:09
Copy link
Collaborator

@BruceMacD BruceMacD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another fix

@BruceMacD BruceMacD merged commit d4ec573 into ollama:main Jul 23, 2024
3 checks passed
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.

2 participants