Fix Cors issue with files endpoints
Issue:
The following endpoint used json.dumps as a return for the endpoints
/refresh-files /select-file
This conflicts with FastAPI's ability to assign the proper response headers causing CORS issues.
Also, the client side handler code was adjusted to work with the FastAPI rendered JSON response.
This seems like the right fix to me! CORS is a weird tripping point though, are you sure it's CORS and not the lack of content-type in the response?
This seems like the right fix to me! CORS is a weird tripping point though, are you sure it's CORS and not the lack of
content-typein the response?
Yeah, I'm sure.
For this particular issue json.dumps conflicts with FASTAPI sending the CORS response headers. From the client-side it produces the typical CORS error where the response is blocked. The Content-Type as application/json is present in the response header.