Match request Accept-Language with response Content-Language. Language matching is a little more complicated because of "ranges". First, no Accept-Language header or no Content-Language headers match with q of 1. Otherwise, loop over Content-Languages. If there is a match with a language in the Accept-Language field, keep track of how many characters were in the value. The q value for t
| 1050 | |
| 1051 | */ |
| 1052 | static inline bool |
| 1053 | does_language_range_match(const char *range1, const char *range2) |
| 1054 | { |
| 1055 | while (*range1 && *range2 && (ParseRules::ink_tolower(*range1) == ParseRules::ink_tolower(*range2))) { |
| 1056 | range1 += 1; |
| 1057 | range2 += 1; |
| 1058 | } |
| 1059 | |
| 1060 | // matches if range equals tag, or if range is a lang prefix of tag |
| 1061 | if ((((*range1 == NUL) && (*range2 == NUL)) || ((*range1 == NUL) && (*range2 == '-')))) { |
| 1062 | return true; |
| 1063 | } |
| 1064 | |
| 1065 | return false; |
| 1066 | } |
| 1067 | |
| 1068 | static inline bool |
| 1069 | match_accept_content_language(const char *c_raw, MIMEField *accept_field, bool *wildcard_present, float *wildcard_q, float *q, |
no outgoing calls
no test coverage detected