http response missing headers when using chrome
Hi, i am developing a basic app that requires authentication, and i noticed that it works on ios but not on chrome(web). after a little debugging it seems like the Response object always contains only the 2 headers - content length and content type, and none of the other headers (set cookies etc). all the configuration seems fine. I also tried to manually add withCredentials and it didn't help. see screenshots



I have the same issue with Chrome Web, except I'm looking for an "authorization" header entry with my "Bearer" token. Works on Android, but not on Web.
I can see the full headers while inspecting the call in Chrome, but it doesn't show up in the app.
I fixed my problem! It's a CORS issue and not the http package. I tried the Dio package and got the same problem.
I initially got it working by using the --disable-web-security flag. See this discussion for details:
https://stackoverflow.com/questions/65630743/how-to-solve-flutter-web-api-cors-error-only-with-dart-code
But I wasn't crazy about this solution, since I can see it becoming a bigger issue when I try to deploy the app. Since I'm using Rails for my backend, I managed to find this solution: https://glaucocustodio.github.io/2016/01/20/dont-forget-to-expose-headers-when-using-rack-cors/
Not sure if it'll help, but I added expose: ['authorization', 'Authorization'] to my cors.rb file. Back in business!
Have you found the solutions? I am also facing the same problem. The "set-cookie" header is still missing even if apply @dparfrey solution.
@trackilive I did not try further investigation by manipulating the cookies since the web app works well via web, ios, android... Also, I followed the Django (my web app) CORS guidelines. The only problem was with flutter web app. So I have some doubt in this solution, but either way i currently just perform the network debugging and developing using the simulators instead. it's less comfortable but it works
As mentioned above this is a CORS browser policy issue and is not related to this package. A Access-Control-Expose-Headers header in the response can allow the browser to expose more of these headers.
Hi, adding "Access-Control-Expose-Headers" from server side and enabling CORS , for me the problem is not resolved, Can you help me?
Can you help me?
You'd probably find better help in a place more oriented towards help debugging server/browser issues, like stack overflow.
Can you help me?
You'd probably find better help in a place more oriented towards help debugging server/browser issues, like stack overflow.

I have attached logs..have you suggestions? I have tried also adding "*, Authorization" on Access-Control-Expose-Headers having the same results.
Thanks
I have verified that the problem is about the content-type:
- using content-type 'application/x-www-form-urlencoded; charset=UTF-8' on the request, authorization is not present into client side
- using content-type 'application/json; charset=UTF-8' on the request, authorization is present correctly into client side
Do you have suggestions? Thanks