However, according to RFC7230, Sect. 3.2.6. tokens can start with a number of specials characters. parse_dictionary/1 fails on them:
> cow_http_struct_hd:parse_dictionary(<<"token=5abcxyz">>).
** exception error: no function clause matching cow_http_struct_hd:parse_dict_before_sep(<<"abcxyz">>,[{<<"token">>,{item,5,[]}}]) (/usr/src/erlang/cowlib/src/cow_http_struct_hd.erl, line 84)
and
cow_http_struct_hd:parse_dictionary(<<"token=!abcxyz">>).
** exception error: no function clause matching cow_http_struct_hd:parse_bare_item(<<"!abcxyz">>) (/usr/src/erlang/cowlib/src/cow_http_struct_hd.erl, line 179)
in function cow_http_struct_hd:parse_item1/1 (/usr/src/erlang/cowlib/src/cow_http_struct_hd.erl, line 106)
in call from cow_http_struct_hd:parse_dict_key/3 (/usr/src/erlang/cowlib/src/cow_http_struct_hd.erl, line 72)
cow_http_struct_hd:parse_dictionary/1 does detect tokens when they start with an
APLHA
, e.g.:However, according to RFC7230, Sect. 3.2.6. tokens can start with a number of specials characters. parse_dictionary/1 fails on them:
and