[PR #10813] api: improve HTTP client security configuration #23913

Open
opened 2026-04-19 17:17:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10813
Author: @zucchinidev
Created: 5/22/2025
Status: 🔄 Open

Base: mainHead: default-http-client


📝 Commits (1)

  • b7e696b api: improve HTTP client security configuration

📊 Changes

2 files changed (+57 additions, -4 deletions)

View changed files

📝 api/client.go (+55 -2)
📝 api/client_test.go (+2 -2)

📄 Description

This changes Ollama to use more secure and robust HTTP client configurations in the API package. The changes include:

  • Improved timeout configurations for better reliability
  • Enhanced transport security settings
  • Better connection pooling management
  • More robust HTTP/2 handling
  • Improved keep-alive and compression settings

The changes follow Go best practices for HTTP client configuration and improve the overall robustness of the API client.

Testing:
I have:

  • Updated existing tests to use the new client configuration
  • Verified all tests pass with the new settings
  • Tested the changes with various network conditions
  • Ensured backward compatibility is maintained

Documentation:
I have:

  • Added clear comments explaining the configuration choices
  • Updated package documentation to reflect security considerations
  • Added inline documentation for timeout values and their purposes

🔄 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/pull/10813 **Author:** [@zucchinidev](https://github.com/zucchinidev) **Created:** 5/22/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `default-http-client` --- ### 📝 Commits (1) - [`b7e696b`](https://github.com/ollama/ollama/commit/b7e696bfadcd3e7ed07dbe7581031848adc5d483) api: improve HTTP client security configuration ### 📊 Changes **2 files changed** (+57 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+55 -2) 📝 `api/client_test.go` (+2 -2) </details> ### 📄 Description This changes Ollama to use more secure and robust HTTP client configurations in the API package. The changes include: - Improved timeout configurations for better reliability - Enhanced transport security settings - Better connection pooling management - More robust HTTP/2 handling - Improved keep-alive and compression settings The changes follow Go best practices for HTTP client configuration and improve the overall robustness of the API client. **Testing:** I have: - Updated existing tests to use the new client configuration - Verified all tests pass with the new settings - Tested the changes with various network conditions - Ensured backward compatibility is maintained **Documentation:** I have: - Added clear comments explaining the configuration choices - Updated package documentation to reflect security considerations - Added inline documentation for timeout values and their purposes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 17:17:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#23913