[PR #13365] CORS: allow all headers #19450

Open
opened 2026-04-16 07:07:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13365
Author: @alexgleason
Created: 12/7/2025
Status: 🔄 Open

Base: mainHead: cors-allow-all


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -22 deletions)

View changed files

📝 server/routes.go (+1 -22)

📄 Description

Chasing after CORS headers (eg https://github.com/ollama/ollama/pull/10276 ) is a cat and mouse game, and security theater. Virtually all public OpenAI-compatible API's I've tested (OpenRouter, xAI, OpenRouter... even OpenAI itself!) allow all CORS headers

My usecase is that I want to pass OpenRouter's App Attribution headers (X-Title and HTTP-Referer) without a conditional. I have 12 different AI providers configured and all of them work except for ollama. Therefore, I conclude Ollama does not correctly implement an OpenAI-compatible API unless it accepts all headers.


🔄 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/13365 **Author:** [@alexgleason](https://github.com/alexgleason) **Created:** 12/7/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `cors-allow-all` --- ### 📝 Commits (1) - [`fc5621b`](https://github.com/ollama/ollama/commit/fc5621b14861043c3130524847adf3bcd2bd2239) CORS: allow all headers ### 📊 Changes **1 file changed** (+1 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+1 -22) </details> ### 📄 Description Chasing after CORS headers (eg https://github.com/ollama/ollama/pull/10276 ) is a cat and mouse game, and security theater. Virtually all public OpenAI-compatible API's I've tested (OpenRouter, xAI, OpenRouter... even OpenAI itself!) allow all CORS headers My usecase is that I want to pass OpenRouter's [App Attribution headers](https://openrouter.ai/docs/app-attribution) (X-Title and HTTP-Referer) without a conditional. I have 12 different AI providers configured and **all** of them work except for ollama. Therefore, I conclude Ollama does not correctly implement an OpenAI-compatible API unless it accepts all headers. --- <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-16 07:07:49 -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#19450