Skip to content

Commit

Permalink
DON'T MERGE - test CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtropets committed Jan 17, 2025
1 parent 3cb8919 commit 263aced
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/ccf/http_accept.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,28 @@ namespace ccf::http

bool operator<(const AcceptHeaderField& other) const
{
static constexpr auto float_comp_epsilon = 0.0000001f;
if (abs(q_factor - other.q_factor) > float_comp_epsilon)
if (q_factor != other.q_factor)
{
return q_factor < other.q_factor;
}

if (is_wildcard(mime_type) && !is_wildcard(other.mime_type))
if (is_wildcard(mime_type))
{
return true;
}
else if (is_wildcard(other.mime_type))
{
return false;
}

if (is_wildcard(mime_subtype) && !is_wildcard(other.mime_subtype))
if (is_wildcard(mime_subtype))
{
return true;
}
else if (is_wildcard(other.mime_subtype))
{
return false;
}

// Spec says these mime types are now equivalent. For stability, we
// order them lexicographically
Expand Down

0 comments on commit 263aced

Please sign in to comment.