403 Forbidden when trying to access api of a public space
Hi,I am having trouble accessing this space:Face Swap - a Hugging Face Space by tonyassithrough api. Trying to access through js client and also curl, however, both gives 403 forbidden error.Has anyone encountered this too?How to solve this?
2024-08-03T12:37:51Z
Have you checked the CORS configuration to ensure that the origin from which you are making the request is allowed? On the server, the CORS settings should include the domain from which you are accessing the API. For example, if you are using FastAPI, add the CORS middleware like this:from fastapi.middleware.cors import CORSMiddleware

app.add_middleware(
    CORSMiddleware,
    allow_origins=["https://your-domain.com"], 
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
2024-08-05T10:55:58Z
I was trying to use fetch from my client side code.And the space is a public one and I don’t have the code for that…
2024-08-05T12:42:13Z
Although trying the request from postman gives correct response.Same request from localhost gives 403 forbidden