Giter Site home page Giter Site logo

CORS issue about ai-horde HOT 13 CLOSED

haidra-org avatar haidra-org commented on June 8, 2024
CORS issue

from ai-horde.

Comments (13)

db0 avatar db0 commented on June 8, 2024 1

It sounds like it was failing because the request was expiring. It should be better now as I increased the expiry timeout to give more time during high load. Async would avoid the connection ending like that and you would get more info

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

It seems the error is returned about 3 minutes after the request has been made.

from ai-horde.

db0 avatar db0 commented on June 8, 2024

Any idea what header I need to allow to fix this?

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

Access-Control-Allow-Origin: *

from ai-horde.

db0 avatar db0 commented on June 8, 2024

It seems I'm already allowing that: https://github.com/db0/AI-Horde/blob/main/horde/__init__.py#L33

from ai-horde.

db0 avatar db0 commented on June 8, 2024

I've put the header in my reverse proxy as well. Maybe it will work for you now?

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

No, here is my console.log value:

Access to fetch at 'https://stablehorde.net/api/v2/generate/sync' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

It immediately fails every time now.

from ai-horde.

db0 avatar db0 commented on June 8, 2024

welp! OK removed it from apache. Did it stop failing immediately now?

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

Yes, it seems to work again.

from ai-horde.

db0 avatar db0 commented on June 8, 2024

But still randomly failing?

from ai-horde.

db0 avatar db0 commented on June 8, 2024

Anyway, I suggest you use async instead, as it will allow you to get the status of the request while waiting as well

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

But still randomly failing?

Difficult to know. It was failing previously when the number of workers were low and after 3 minutes. It seems to work correctly right now. I suspect it fails only when it has to send an error.

from ai-horde.

leszekhanusz avatar leszekhanusz commented on June 8, 2024

Anyway, I suggest you use async instead, as it will allow you to get the status of the request while waiting as well

Yes, I was planning to switch to async once it works correctly in sync mode.

from ai-horde.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.