http_parser icon indicating copy to clipboard operation
http_parser copied to clipboard

Exception when content-type contains colon

Open ghost opened this issue 2 years ago • 0 comments
trafficstars

Testing versions:

4.0.2 and c14fbf

Steps to Reproduce:

  1. Find any instance of diaspora*, Mobilizon, Pleroma, Akkoma, Funkwhale or WriteFreely (you can use Fediverse Observer)
  2. Open https://<instance>/.well-known/nodeinfo
  3. Take any link with href key and try to load it via http package

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)

ghost avatar Aug 02 '23 16:08 ghost