title: If a weighted HTTP header has duplicate values, with differing weights, how should this be handled?
body: <p>Values of request headers, such as <code>Accept-Language</code>, <code>Accept-Encoding</code>, etc., have either implicitly or explicitly weighted values (<code>en; q=0.8</code> for instance).</p>
  <p>In the unlikely event that the parsed value of the complete field value yields ambiguous information, specifically if the ambiguity can be interpreted as either not acceptable (<code>q=0</code>) or acceptable because of some non-zero quality value, for example:</p>
  <pre><code>Accept-Encoding: gzip; q=0.8, gzip; q=0
  </code></pre>
  <p>should this be interpreted as:</p>
  <ol>
  <li>not acceptable;</li>
  <li>acceptable;</li>
  <li>header is invalid;</li>
  </ol>
  <p>or some other option, perhaps?</p>
  <p>In <a href="https://www.rfc-editor.org/rfc/rfc7231" rel="nofollow noreferrer">RFC 7231</a>, the general <a href="https://www.rfc-editor.org/rfc/rfc7231#section-5.3.1" rel="nofollow noreferrer">section 5.3.1</a> on quality values</p>
  <blockquote>
  <p>The weight is normalized to a real number in the range 0 through 1,
  where 0.001 is the least preferred and 1 is the most preferred; a
  value of 0 means &quot;not acceptable&quot;.  If no &quot;q&quot; parameter is present,
  the default weight is 1.</p>
  </blockquote>
  <p>and the <code>Accept-Encoding</code>-specific <a href="https://www.rfc-editor.org/rfc/rfc7231#section-5.3.4" rel="nofollow noreferrer">section 5.3.4</a>, subsection 3 and 4</p>
  <blockquote>
  <ol start="3">
  <li><p>If the representation's content-coding is one of the
  content-codings listed in the Accept-Encoding field, then it is
  acceptable unless it is accompanied by a qvalue of 0.  (As
  defined in Section 5.3.1, a qvalue of 0 means &quot;not acceptable&quot;.)</p>
  </li>
  <li><p>If multiple content-codings are acceptable, then the acceptable
  content-coding with the highest non-zero qvalue is preferred.</p>
  </li>
  </ol>
  </blockquote>
  <p>clearly say <code>q=0</code> means &quot;not acceptable&quot; and that the highest non-zero qvalue is preferred, but they don't appear to discuss any possible ambiguity; probably because it is such an unlikely event.</p>