mjackson / rack-accept

HTTP Accept* for Ruby/Rack
http://mjackson.github.com/rack-accept
47 stars 16 forks source link

[bugfix] Allow all characters in mediatype name per RFC6838 - most notably the underscore #17

Closed jerrod closed 4 years ago

jerrod commented 9 years ago

I have updated the parse_media_type method to match additional characters allowed in media type names per RFC6838.

Type and subtype names MUST conform to the following ABNF:

     type-name = restricted-name
     subtype-name = restricted-name

     restricted-name = restricted-name-first *126restricted-name-chars
     restricted-name-first  = ALPHA / DIGIT
     restricted-name-chars  = ALPHA / DIGIT / "!" / "#" /
                              "$" / "&" / "-" / "^" / "_"
     restricted-name-chars =/ "." ; Characters before first dot always
                                  ; specify a facet name
     restricted-name-chars =/ "+" ; Characters after last plus always
                                  ; specify a structured syntax suffix
aselder commented 8 years ago

:+1: Can we get this merged and the gem bumped

dblock commented 8 years ago

:+1: cc: @mjackson