electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
114.44k stars 15.45k forks source link

Content-Type change to 'text/plain' when build the app in windows #20990

Closed sinhvt3421 closed 4 years ago

sinhvt3421 commented 5 years ago

Preflight Checklist

Issue Details

Expected Behavior

I wrote an application that send post request with FormData or Json to Flask python server. When in developer mode, the request is always successful with header : "multipart/formdata" or "application/json".

Actual Behavior

But when I build the app with electron-builder , yarn dist, the request fails because the header is only "text/plain" that the Flask server couldn't parse the data.

To Reproduce

My application was written with Reactjs and I first try fetch in React but it failed. I aslo used ipcRenderer, ipcMan to handle the request but it only ran correctly on dev mode.

Is it a problem about CORs or something like that which happens when packing app ?

RahZero0 commented 9 months ago

How did you solve this I am also facing the same issue . Any help??