Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Header in Dio Web #2356

Open
YukiAttano opened this issue Jan 17, 2025 · 0 comments
Open

Missing Header in Dio Web #2356

YukiAttano opened this issue Jan 17, 2025 · 0 comments
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working

Comments

@YukiAttano
Copy link

Package

dio

Version

5.7.0

Operating-System

Web

Adapter

Default Dio

Output of flutter doctor -v

[✓] Flutter (Channel stable, 3.27.0, on macOS 15.0.1 24A348 darwin-arm64, locale de-DE)
    • Flutter version 3.27.0 on channel stable at /Users/user/Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8495dee1fd (5 weeks ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

Dart Version

3.6.0

Steps to Reproduce

Downloading a file on a native device returns all expected header.
Downloading a file in web lacks some header, see differences in 'Expected Result' and 'Actual Result'

Specifically, i am missing the 'content-disposition: attachment; filename=Filename.txt;' Header in web, which is received but not accessible in Dio on web platforms.

Call a link to download a file.

Options options = Options(responseType: ResponseType.stream);

Response<ResponseBody> r = await dio.request("https://file.example.com/Files/some_file", options: options);

print(r.headers);

Expected Result

Image

Actual Result

Logged with Dio Tralker

┌─────────────────────────────────────────────────────────────────
│ [http-response] [GET] https://file.example.com/Files/some_file
│ Status: 200
│ Message: 
│ Headers: {
│   "cache-control": [
│     "no-cache, no-store"
│   ],
│   "content-length": [
│     "235800"
│   ],
│   "content-type": [
│     "application/octet-stream"
│   ],
│   "pragma": [
│     "no-cache"
│   ]
│ }
└─────────────────────────────────────────────────────────────────
@YukiAttano YukiAttano added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant