You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for a similar issue in the project and found none
Issue Info
Info
Value
Platform Name
ios / android
Platform Version
3.0.1
Dio Version
2.5.0 "macos_x64"
Android Studio / Xcode Version
Repro rate
100%
Issue Description and Steps
In my case, I tried to request a url with header "content-type: application/json",
I got response with code:401, while response headers do not contain "content-type",
then I got an exception
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.
New Issue Checklist
Issue Info
Issue Description and Steps
In my case, I tried to request a url with header "content-type: application/json",
I got response with code:401, while response headers do not contain "content-type",
then I got an exception
Exception has occurred.
DioError (DioError [DioErrorType.DEFAULT]: Invalid argument(s)
#0 _RegExp.matchAsPrefix (dart:core-patch/regexp_patch.dart:238:28)
#1 StringScanner.matches (package:string_scanner/src/string_scanner.dart:169:26)
#2 StringScanner.scan (package:string_scanner/src/string_scanner.dart:126:19)
#3 new MediaType.parse. (package:http_parser/src/media_type.dart:48:15)
#4 wrapFormatException (package:http_parser/src/utils.dart:13:16)
#5 new MediaType.parse (package:http_parser/src/media_type.dart:46:12)
#6 DefaultTransformer._isJsonMime (package:dio/src/transformer.dart:140:22)
#7 DefaultTransformer.transformResponse (package:dio/src/transformer.dart:129:9)
#8 DioMixin._dispatchRequest (package:dio/src/dio.dart:924:38)
#9 DioMixin._request._interceptorWrapper... (package:dio/src/dio.dart:828:37)
#10 DioMixin.checkIfNeedEnqueue (package:dio/src/dio.dart:1100:22)
#11 DioMixin._request._interceptorWrapper.. (package:dio/src/dio.dart:825:22)
#12 new Future. (dart:async/future.dart:176:37)
#13 _rootRun (dart:async/zone.dart:1120:38)
#14 _CustomZone.run (dart:async/zone.dart:1021:19)
#15 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#16 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
#17 _rootRun (dart:async/zone.dart:1124:13)
#18 _CustomZone.run (dart:async/zone.dart:1021:19)
#19 _CustomZone.bindCallback. (dart:async/zone.dart:947:23)
#20 Timer._createTimer. (dart:async-patch/timer_patch.dart:21:15)
#21 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#22 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
)
response headers:
HTTP/1.1 401
X-Application-Context gateway-service:test:8089
X-Foo 08011803-62de-4917-812c-1ebb2595faac
Transfer-Encoding chunked
Date Tue, 24 Sep 2019 06:57:25 GMT
Connection keep-alive
I found that exception here:
I got exception because the RESPONSE HEADERS DO NOT CONTAIN "content-type".
Is it necessary?
Or it is a bug?
The text was updated successfully, but these errors were encountered: