Skip to content

fix: strip whitespace from host values#691

Open
lin-hongkuan wants to merge 1 commit into
ollama:mainfrom
lin-hongkuan:codex/strip-host-whitespace
Open

fix: strip whitespace from host values#691
lin-hongkuan wants to merge 1 commit into
ollama:mainfrom
lin-hongkuan:codex/strip-host-whitespace

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • Strip leading and trailing whitespace before parsing explicit host values.
  • Cover host strings with schemes, ports, and paths.

Why

Values copied into OLLAMA_HOST or passed as a host argument can include surrounding whitespace. Without trimming, host parsing can produce an invalid base URL or raise while parsing the port.

Testing

  • python -m pytest tests/test_client.py::test_parse_host_strips_whitespace tests/test_client.py::test_headers -q
  • git diff --check

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