Closed u5surf closed 2 years ago
Thanks for opening this PR! On reviewing the spec, you're indeed right that our current implementation is not compliant - but this PR doesn't implement the ordering dictated by the spec either.
I've written an analysis of the issues we have in our content negotiation in https://github.com/http-rs/http-types/issues/361#issuecomment-1008872107, and my hope is that we can use that to implement a spec-compliant fix.
I'm going to close this PR for now since it doesn't match the spec. But I'd be keen to review any follow-up PRs which help bring our content-negotiation implementation according to spec. Thanks!
Fixes: #361
Implements Clone for Accept in order to copy it to tmporary variable and evaluate with it inside negotiate method, so that self cannot be sorted each negotiate is called.
Add a test which evaluates negotiation properly the header which has same weight.