[GH-ISSUE #3780] Why not turn on CORS? #64373

Closed
opened 2026-05-03 17:24:52 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @liuhuapiaoyuan on GitHub (Apr 20, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3780

What is the issue?

func DefaultConfig() Config {
return Config{
AllowMethods:     []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"},
AllowHeaders:     []string{"Origin", "Content-Length", "Content-Type"},
AllowCredentials: false,
MaxAge:           12 * time.Hour,
}
}

These are the default options, now that you can override the origins with OLLAMA_ORIGINS, why not add an environment variable to configure the AllowHeaders too? eg. OLLAMA_ALLOW_HEADERS ?

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @liuhuapiaoyuan on GitHub (Apr 20, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3780 ### What is the issue? ```golang func DefaultConfig() Config { return Config{ AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}, AllowHeaders: []string{"Origin", "Content-Length", "Content-Type"}, AllowCredentials: false, MaxAge: 12 * time.Hour, } } ``` These are the default options, now that you can override the origins with `OLLAMA_ORIGINS`, why not add an environment variable to configure the `AllowHeaders` too? eg. `OLLAMA_ALLOW_HEADERS` ? ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-03 17:24:52 -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#64373