JosiahWI commented on code in PR #12618:
URL: https://github.com/apache/trafficserver/pull/12618#discussion_r2466190953
##########
src/iocore/cache/HttpTransactCache.cc:
##########
@@ -979,60 +979,38 @@
HttpTransactCache::calculate_quality_of_accept_encoding_match(MIMEField *accept_
if (!content_field) {
if (!match_accept_content_encoding("identity", accept_field,
&wildcard_present, &wildcard_q, &q)) {
// CE was not returned, and AE does not have identity
- if (match_content_encoding(accept_field, "gzip") and
match_content_encoding(cached_accept_field, "gzip")) {
- return 1.0f;
- }
goto encoding_wildcard;
}
- // use q from identity match
-
} else {
- // "Accept-encoding must correctly handle multiple content encoding"
- // The combined quality factor is the product of all quality factors.
- // (Note that there may be other possible choice, eg, min(),
- // but I think multiplication is the best.)
- // For example, if "content-encoding: a, b", and quality factors
- // of a and b (in accept-encoding header) are q_a and q_b, resp,
- // then the combined quality factor is (q_a * q_b).
- // If any one of the content-encoding is not matched,
- // then the q value will not be changed.
- float combined_q = 1.0;
+ // Handle multiple content encodings - use minimum quality
+ float min_q = 1.0; // Start with maximum quality
+ bool found_match = false;
+
for (c_value = c_values_list.head; c_value; c_value = c_value->next) {
float this_q = -1.0;
if (!match_accept_content_encoding(c_value->str, accept_field,
&wildcard_present, &wildcard_q, &this_q)) {
goto encoding_wildcard;
}
- combined_q *= this_q;
+ if (this_q >= 0.0) {
+ found_match = false;
Review Comment:
```suggestion
found_match = true;
```
?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]