Open badeend opened 2 years ago
I've transferred this from wasi-io to the main WASI repo, as wasi-io is being subsumed by the wit stream type. The wit-stream type doesn't have a built in concept of a media_type
, however this is functionality that WASI could add an API to support.
input_media_type
andoutput_media_type
mention:As far as I know, in the world of HTTP the string "
*/*
" is only used as a wildcard in places where a content type filter is expected (Accept header), indicating any content type will do. It is never used as a content type accompanying actual data. For these scenario's where the content type is unknown, "application/octet-stream" is generally used.Additionally, according to RFC-7231 the content type should preferably not be set at all:
That leads me to think type returning None if the content type is unknown. Alternative solution would be to return an empty string, or "application/octet-stream". But not "
input_media_type
&output_media_type
should be changed to be an Option*/*
".References: