helxplatform / dug

Semantic Search
MIT License
32 stars 10 forks source link

Added CORSMiddleware to allow Dug to make CORS requests #326

Closed gaurav closed 1 year ago

gaurav commented 1 year ago

While working with Dug locally, I noticed that it doesn't provide CORS headers (presumably because it expects Kubernetes to do this). Since the API is intended to be used by anybody, I thought it wouldn't hurt to add CORSMiddleware to explicitly allow all direct API requests from browsers, but this is not my area of expertise, so please feel free to ignore this if this isn't ideal or if there is a better way to do this.

YaphetKG commented 1 year ago

@gaurav , I think it might be solvable at the Ingress level. Which instance was doing so?

YaphetKG commented 1 year ago

but it doesn't hurt to have this . I wonder if the issue will still persist if we don't change the ingress thou

gaurav commented 1 year ago

Which instance was doing so?

I ran into this while running Dug locally, so no ingress -- just running uvicorn directly with the backend running in Docker, I think.