Open JesJehle opened 2 months ago
This is a successful response with proxy:
Access_controll_origin: *
@mmaelicke I still getting CORS errors, not longer because of the two allow origin values but this:
Access to fetch at 'https://data.deadtrees.earth/api/v1/datasets' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
Could it be, thatCORSMiddleware
alllowed_methods are incorrectly specified:
app.add_middleware(
CORSMiddleware,
allow_origins=['https://deadtrees.earth', 'https://www.deadtrees.earth'],
allow_origin_regex='http://localhost:.*',
allow_credentials=True,
allow_methods=['OPTIONS, GET, POST, PUT'], // should be a list
allow_headers=['Content-Type', 'Authorization', 'Origin', 'Accept'],
)
Could we simplify this for a moment with
allow_origin='*'
allow_methods='*'
and see if this fixes the issue
Hi, wir hatten es ja bereits davon. Hier noch mal der Fehler:
Hier noch mal die codesanbox: