Cornutum / tcases

A model-based test case generator
MIT License
218 stars 54 forks source link

MediaRange does not accept space after semicolon #237

Closed neofreko closed 2 years ago

neofreko commented 2 years ago

on version 3.8.1 Per w3 spec, the can be space after semicolon. Eg: audio/*; q=0.2, audio/basic

In my case, I found it when server returns: application/json; charset=utf-8

However, current implementation fails on above example.

Probable fix: ([^\s\/]+)\/([^\s+;]+)(?:\+([^\s;]+))?((?:;\s*[^\s;=]+=(?:[^\s";=]+|"(?:[^\"]|\\.)*"))+)?

kerrykimbrough commented 2 years ago

You're right. Although the media range grammar doesn't show it, HTTP basic rules allow "linear white space" (LWS) between tokens and separators. Will fix soon in next release.

kerrykimbrough commented 2 years ago

Fixed in release 3.8.2