[GH-ISSUE #6021] API returns 403 Forbidden when Origin http header is set #65804

Open
opened 2026-05-03 22:45:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jvm123 on GitHub (Jul 28, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6021

What is the issue?

When an API call with the Origin http header is made, ollama responds with 403 Forbidden. Applications such as chatGPTBox use this header and thereby trigger the issue.

Example command that fails:

$ curl http://localhost:11434/v1/chat/completions
-H "Content-Type: application/json" -H "Origin: abc"
-d '{
"model": "llama3.1",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.2.5

Originally created by @jvm123 on GitHub (Jul 28, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6021 ### What is the issue? When an API call with the Origin http header is made, ollama responds with 403 Forbidden. Applications such as [chatGPTBox](https://github.com/josStorer/chatGPTBox) use this header and thereby trigger the issue. Example command that fails: $ curl http://localhost:11434/v1/chat/completions \ -H "Content-Type: application/json" -H "Origin: abc" \ -d '{ "model": "llama3.1", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ] }' ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.2.5
GiteaMirror added the bug label 2026-05-03 22:45:36 -05:00
Author
Owner

@lekoala commented on GitHub (Oct 9, 2024):

had the exact same issue, and it's fixed with https://github.com/ollama/ollama/pull/6010 so hopefully this gets merged soon

<!-- gh-comment-id:2401844644 --> @lekoala commented on GitHub (Oct 9, 2024): had the exact same issue, and it's fixed with https://github.com/ollama/ollama/pull/6010 so hopefully this gets merged soon
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65804