http_parser
http_parser copied to clipboard
Exception when content-type contains colon
trafficstars
Testing versions:
4.0.2 and c14fbf
Steps to Reproduce:
- Find any instance of diaspora*, Mobilizon, Pleroma, Akkoma, Funkwhale or WriteFreely (you can use Fediverse Observer)
- Open
https://<instance>/.well-known/nodeinfo - Take any link with
hrefkey and try to load it viahttppackage
Expected Result:
Just a response
Actual Result:
E/flutter ( 4133): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Error on line 1, column 31: Invalid media type: expected no more input.
E/flutter ( 4133): ╷
E/flutter ( 4133): 1 │ application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8
E/flutter ( 4133): │ ^
E/flutter ( 4133): ╵
E/flutter ( 4133): #0 wrapFormatException (package:http_parser/src/utils.dart:15:5)
E/flutter ( 4133): #1 new MediaType.parse (package:http_parser/src/media_type.dart:46:7)
E/flutter ( 4133): #2 _contentTypeForHeaders (package:http/src/response.dart:79:45)
E/flutter ( 4133): #3 _encodingForHeaders (package:http/src/response.dart:72:24)
E/flutter ( 4133): #4 Response.body (package:http/src/response.dart:28:22)