You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some typed headers do not do proper validation in their constructors making it possible to create invalid instances.
This will typically cause round-tripping such headers to fail, as the decoding of the malformed encoding will fail.
To reproduce
final x =VaryHeader.headers(fields: []); // note the empty fields list.final r =Headers.vary.codec.encode(x); // will be emptyfinal y =Headers.vary.codec.decode(r); // <-- will throw, as empty value not allowed!
Expected behavior
Prevent invalid header instances form being instantiated, ie. validate input in constructor.
Library version
relic: 0.5.0(and prior)
Platform information
any
Additional context
This is related to #144. I believe it may actually be the main (if not sole) reason for the problems with round-tripping.
How experienced are you with this library?
Expert - Experienced and comfortable with using this library in complex projects
Activity
[-]bug: Possible to instantiate invalid headers[/-][+]Possible to instantiate invalid headers[/+]