git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: Justin Tobler <jltobler@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	 git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	 Taylor Blau <me@ttaylorr.com>,
	 Yi EungJun <eungjun.yi@navercorp.com>
Subject: Re: [PATCH 1/1] http: don't send C or POSIX in Accept-Language
Date: Fri, 11 Jul 2025 10:02:01 -0700	[thread overview]
Message-ID: <875xfypsom.fsf@gmail.com> (raw)
In-Reply-To: <r34i7fhxwbxhppc4ia7lpyr3xqj4tgusaeikaaonpwtywlywxw@ygfmv3f3q67u>

Justin Tobler <jltobler@gmail.com> writes:

> From my understanding, each language is expected to be defined in the
> following form:
>
>   language[_territory][.codeset][@modifier]
>
> When we parse the list of languages we only care about the
> `language[_territory]` part though.
>
> From looking at ISO 639 language codes, only codes with two or three
> characters are valid. If we wanted to be a bit more strict, we could
> check the length of the language code (everything before the first '_')
> and filter out anything outside of those limits. This would naturally
> filter out "C" and "POSIX" without having to mention them explicitly.
>
> Not sure if being more strict adds much more value here in practice
> though. So it may be fine to keep it as-is. :)

Filtering out anything that isn't 2-3 letters seems like a good
heuristic to me.

It seems better than only filtering out "C" and "POSIX" and allowing
anything else. And it keeps us from having to keep a list of updated BCP
47 language tags.

Collin

  reply	other threads:[~2025-07-11 17:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 22:16 [PATCH 0/1] Filter C and POSIX out of Accept-Language brian m. carlson
2025-07-10 22:16 ` [PATCH 1/1] http: don't send C or POSIX in Accept-Language brian m. carlson
2025-07-10 22:47   ` Junio C Hamano
2025-07-10 23:08     ` brian m. carlson
2025-07-11 15:23   ` Justin Tobler
2025-07-11 17:02     ` Collin Funk [this message]
2025-07-11 20:57       ` Carlo Marcelo Arenas Belón
2025-07-11 21:29         ` brian m. carlson
2025-07-11 22:12           ` Carlo Arenas
2025-07-11 22:17             ` Collin Funk
2025-07-11 18:32     ` Junio C Hamano
2025-07-11 20:22       ` Carlo Marcelo Arenas Belón
2025-07-15  4:38   ` Eli Schwartz
2025-07-10 22:45 ` [PATCH 0/1] Filter C and POSIX out of Accept-Language Junio C Hamano
2025-07-10 23:08   ` brian m. carlson
2025-07-10 23:26     ` Collin Funk
2025-07-11  2:49       ` [External] " Han Young
2025-07-11 16:46         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xfypsom.fsf@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=eungjun.yi@navercorp.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jltobler@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).