git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] http: Add Accept-Language header if possible

From
Yi, EungJun <semtlenori@gmail.com>
Date
Jul 12, 2014, 18:52 UTC
Message-ID
<CAFT+Tg8HfoFO8T+EJ6DiMj6kRO8h0P7tO2PHTK9BFMMe+Ld_Vg@mail.gmail.com>
In-Reply-To
<20140711173544.GB7856@sigill.intra.peff.net>

Thanks for your detailed review and nice suggestions. I will accept most of them.

2014-07-12 2:35 GMT+09:00 Jeff King <peff@peff.net>:
Show 12 quoted lines
>> +     /* Decide the precision for q-factor on number of preferred languages. */
>> +     if (num_langs + 1 > 100) { /* +1 is for '*' */
>> +             q_precision = 0.001;
>> +             q_format = "; q=%.3f";
>> +     } else if (num_langs + 1 > 10) { /* +1 is for '*' */
>> +             q_precision = 0.01;
>> +             q_format = "; q=%.2f";
>> +     }
>
> I don't mind this auto-precision too much, but I'm not sure it buys us
> anything. We are still setting a hard-limit at 100, and it just means we
> write "0.1" instead of "0.001" sometimes.
It means we use "0.1" if possible.
>From my observation, many major web browsers doesn't or didn't send

q-factor of 2 or 3 decimal places. Google chrome doesn't currently and Mozilla firefox also didn't before 2012 [1]. I think it means some old and naive web servers may not support q-factor of 2 or 3 decimal places because major web browsers don't send it. So I think we should use "0.1" if possible for interoperability with the buggy servers.

But, quite frankly, it is just a possibility and I have no evidence which proves that such kind of buggy servers really exist. Please let me know if anybody know about it.

[1]: http://hg.mozilla.org/integration/mozilla-inbound/rev/b0b07ef904ea
Previous: Eric SunshineNext: Peter Krefting
Message 4 of 9 in “http: Add Accept-Language header if possible”
  1. http: Add Accept-Language header if possibleYi EungJun, Jul 11, 2014
  2. Jeff KingJul 11, 2014
  3. Eric SunshineJul 11, 2014
  4. Yi, EungJunJul 12, 2014
  5. Peter KreftingJul 12, 2014
  6. Eric SunshineJul 13, 2014
  7. Yi, EungJunJul 13, 2014
  8. Junio C HamanoJul 13, 2014
  9. Yi, EungJunJul 14, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.