New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customizing allowed headers in CORS settings #669
Comments
Quick update: I found a middleware that intercepted the fetch calls to add custom headers. Blocking the middleware for requests to Ollama did the trick. However, it would still be nice to be able to control this natively. |
Hi @spaceemotion, Hope this helps! Sorry for taking awhile to respond. |
Did anyone find a solution to make this work on Firefox as well? I'm not sure whether it's missing user agent headers or whether it's http to https connection problem. I currently run:
This works on Chromium (like Chrome and Edge) but not FF. FF gives me a link to this and the logs show a 204 error.
Background: I want to make the Ollama SemanticFinder integration work in FF too. |
|
The issue is precisely this, right. I suppose one could just route everything over a proxy like https://corsproxy.io/ but I'd prefer a clean solution not relying on a third-party service. |
I am get the same error even I am run with chrome, is there any way to solve this error with |
same here |
same issue! please resolve this issue |
I followed the steps here for Linux but I am still getting this error in Chrome:
|
@ewantindale the class NoStainlessOpenAI extends OpenAI {
defaultHeaders(opts: FinalRequestOptions) {
return {
Accept: 'application/json',
'Content-Type': 'application/json',
...this.authHeaders(opts),
};
}
} |
Thanks, fixed that issue but now I get
I am following the instructions here: https://github.com/ollama/ollama/blob/main/docs/openai.md |
@ewantindale you can just remove this line from the extended class: ...this.authHeaders(opts), |
Same issue on FF on ubuntu, but working with Chromium. |
Based on some additional research on an issue I have (#300 (comment)), I am getting the following error in chrome/firefox:
(see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowHeaderFromPreflight for details)
It would be helpful to allow all headers (if possible?) as I am able to call the API via tools like curl, postman, etc., but not using
fetch()
from a webpage. This does not need to be the default, an env variable likeOLLAMA_HOST
and such works for me.The text was updated successfully, but these errors were encountered: