cfug / dio

A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
https://dio.pub
MIT License
12.5k stars 1.51k forks source link

Date header not parsed correctly #2269

Open hampsterx opened 3 months ago

hampsterx commented 3 months ago

Package

dio

Version

5.5

Operating-System

Web

Adapter

Default Dio

Output of flutter doctor -v

No response

Dart Version

No response

Steps to Reproduce

Date field is in RFC 2616 format, it includes a comma in the value. eg

Date => "Tue, 09 Jul 2024 19:39:05 GMT"

dio_web_adapter appears to be using

  headers: xhr.responseHeaders.map((k, v) => MapEntry(k, v.split(','))),

Expected Result

The full value not split.

Actual Result

"date" header as "Tue"

Reprevise commented 2 months ago

@AlexV525 Do your changes here fix this issue?https://github.com/cfug/dio/blob/679a14410817357e4b4cb8cee75a3f585d675803/plugins/web_adapter/lib/src/adapter.dart#L312-L333

AlexV525 commented 4 weeks ago

Is there a working version for the implementation?