socketio.wsgiApp staticfiles cors issues. #769
-
i have a problem with cors and serving static files for wsgi, it seems to ignore the
My implementation of the served files are in react, and download the file as seen in the screen shot. but i get the follwing cors error when using the served file from the wsgiApp, as visable from the error it is not on the same computer, but over lan. If i use a database i have with same cors allow *, then i get the file as expected in react. the file is served, since i can access by putting in the file url in a browser and downloading the file, on the same computer that is hosting the react project. i am running deprecated python-socketio (4.6.1) becauce i cant upgrade to python 3,5 eventlet (0.31.1) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The static file serving app does not have CORS configuration, so it must be used within a same origin context, or else the CORS configuration must be inserted by a reverse proxy (nginx). The purpose of serving static files is to aid in the development of your app by serving your client files. If you have needs that are larger than this, then I suggest you add your own file serving solution based on Flask or similar framework. |
Beta Was this translation helpful? Give feedback.
The static file serving app does not have CORS configuration, so it must be used within a same origin context, or else the CORS configuration must be inserted by a reverse proxy (nginx).
The purpose of serving static files is to aid in the development of your app by serving your client files. If you have needs that are larger than this, then I suggest you add your own file serving solution based on Flask or similar framework.