http icon indicating copy to clipboard operation
http copied to clipboard

Can't retrieve response headers on flutter web

Open MarcoDiGioia opened this issue 2 years ago • 5 comments

Hi!

I can't get any response header from xhr response. Only "content-type" -> "application/json" and "content-length" -> "206" are retrieved

I did some debug and this only happen when executing send method from BrowserClient. Instead, with the same api, in flutter using IoClient all works as expected.

Of course domain of cookies it's the same from web app domain.

In order to reproduce the bug you can do any simple http request that put headers in response.

MarcoDiGioia avatar Jun 28 '22 22:06 MarcoDiGioia

I am also facing the same issue so, any update on this issue ?

sachinbpatil619 avatar Feb 16 '23 13:02 sachinbpatil619

Setting the header param "Access-Control-Expose-Headers" = "*" from the server side did the trick.

venkadesh-p avatar Feb 16 '23 14:02 venkadesh-p

Setting the header param "Access-Control-Expose-Headers" = "*" from the server side did the trick.

Bless you

V1CTOR-cloud avatar Nov 22 '23 14:11 V1CTOR-cloud

+1 on the bless you!

Created MR to document this: https://github.com/dart-lang/http/pull/1062

randomizedcoder avatar Nov 30 '23 18:11 randomizedcoder

New smaller MR: https://github.com/dart-lang/http/pull/1083

randomizedcoder avatar Dec 18 '23 16:12 randomizedcoder