[GH-ISSUE #13420] CORS header Access-Control-Allow-Origin missing for redirect response 301 #34621

Open
opened 2026-04-22 18:20:38 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @SirNate0 on GitHub (Dec 11, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13420

What is the issue?

It seems ollama does not supply the needed header when causing a redirect. For example, if the page requests http://server:11434//api/tags rather than http://server:11434/api/tags. It attempts to redirect to that page, but the redirect is blocked (at least in Firefox) because it is missing the CORS header.

Relevant log output

Response headers with redirect:

HTTP/1.1 301 Moved Permanently
Location: /api/tags
Date: Thu, 11 Dec 2025 04:08:23 GMT
Content-Length: 0

Response Headers without redirect (i.e. requesting the target of the blocked redirect).

HTTP/1.1 204 No Content
Access-Control-Allow-Headers: Authorization,Content-Type,User-Agent,Accept,X-Requested-With,Openai-Beta,X-Stainless-Arch,X-Stainless-Async,X-Stainless-Custom-Poll-Interval,X-Stainless-Helper-Method,X-Stainless-Lang,X-Stainless-Os,X-Stainless-Package-Version,X-Stainless-Poll-Helper,X-Stainless-Retry-Count,X-Stainless-Runtime,X-Stainless-Runtime-Version,X-Stainless-Timeout
Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 43200
Allow: HEAD, GET
Date: Thu, 11 Dec 2025 04:08:27 GMT

OS

Kubuntu

Ollama version

ollama version is 0.13.1

Originally created by @SirNate0 on GitHub (Dec 11, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13420 ### What is the issue? It seems ollama does not supply the needed header when causing a redirect. For example, if the page requests `http://server:11434//api/tags` rather than `http://server:11434/api/tags`. It attempts to redirect to that page, but the redirect is blocked (at least in Firefox) because it is missing the CORS header. ### Relevant log output Response headers with redirect: ``` HTTP/1.1 301 Moved Permanently Location: /api/tags Date: Thu, 11 Dec 2025 04:08:23 GMT Content-Length: 0 ``` Response Headers without redirect (i.e. requesting the target of the blocked redirect). ``` HTTP/1.1 204 No Content Access-Control-Allow-Headers: Authorization,Content-Type,User-Agent,Accept,X-Requested-With,Openai-Beta,X-Stainless-Arch,X-Stainless-Async,X-Stainless-Custom-Poll-Interval,X-Stainless-Helper-Method,X-Stainless-Lang,X-Stainless-Os,X-Stainless-Package-Version,X-Stainless-Poll-Helper,X-Stainless-Retry-Count,X-Stainless-Runtime,X-Stainless-Runtime-Version,X-Stainless-Timeout Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS Access-Control-Allow-Origin: * Access-Control-Max-Age: 43200 Allow: HEAD, GET Date: Thu, 11 Dec 2025 04:08:27 GMT ``` ### OS Kubuntu ### Ollama version ollama version is 0.13.1
GiteaMirror added the bug label 2026-04-22 18:20:38 -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#34621