Accept header sort is not stable leading to unstable negotiation result
Open
bug
good first issue
- Dominant language
- Rust
- Stars
- 209
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
The following test passes:
```rust
#[test]
fn negotiate_tie() -> crate::Result<()> {
let mut accept = Accept::new();
accept.push(MediaTypeProposal::new(mime::HTML, Some(0.4))?);
accept.push(MediaTypeProposal::new(mime::XML, Some(0.4))?);
assert_eq!(accept.negotiate(&[mime::HTML, mime::XML])?, mime::XML);
assert_eq!(accept.negotiate(&[mime::XML, mime::HTML])?, mime::HTML);
Ok(())
}
```
`XML` (or `HTML`?) should be picked the two times.
Contributor guide
Assessment
This issue has not been assessed yet.