<?xml version='1.0' encoding='utf-8'?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Matthias Kestenholz: Posts about TIL</title><link href="https://406.ch/writing/category-til/atom.xml" rel="self" /><link href="https://406.ch/writing/category-til/" rel="alternate" /><id>https://406.ch/writing/category-til/</id><updated>2025-02-13T12:00:00Z</updated><author><name>Matthias Kestenholz</name></author><entry><title>TIL: Tools exist which do not lowercase domain names when requesting websites over HTTP(S)</title><link href="https://406.ch/writing/til-tools-exist-which-do-not-lowercase-domain-names-when-requesting-websites-over-http-s/" rel="alternate" /><id>https://406.ch/writing/til-tools-exist-which-do-not-lowercase-domain-names-when-requesting-websites-over-http-s/</id><published>2025-02-13T12:00:00Z</published><updated>2025-02-13T12:00:00Z</updated><summary type="html">&lt;h1 id="til-tools-exist-which-do-not-lowercase-domain-names-when-requesting-websites-over-https"&gt;&lt;a class="toclink" href="#til-tools-exist-which-do-not-lowercase-domain-names-when-requesting-websites-over-https"&gt;TIL: Tools exist which do not lowercase domain names when requesting websites over HTTP(S)&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;About a week ago I received error mails for a surprising behavior (to me!)
where some tool requested an URL from one of our websites using
&lt;a href="https://github.com/feincms/feincms3-language-sites/"&gt;feincms3-language-sites&lt;/a&gt;
(a Django library for multilingual websites) with a domain name containing
uppercase characters.&lt;/p&gt;
&lt;p&gt;I knew that the domain part of all sorts of URLs is case sensitive, but what
surprised me was that our server actually got a request with such a domain
name, I hadn’t really seen that before.&lt;/p&gt;
&lt;p&gt;After researching a bit I learned that for example &lt;a href="https://curl.se/"&gt;curl&lt;/a&gt;
intentionally preserves the casing of domain names, but browsers generally do
lowercase domains because it’s more consistent. It’s interesting that the
initial error was caused by a client with a proper Safari/macOS user agent, but
further research showed that the request was probably sent by something called
&lt;code&gt;go-social-activity-parser&lt;/code&gt;, whatever that is.&lt;/p&gt;
&lt;p&gt;I fixed the bug in
&lt;a href="https://github.com/feincms/feincms3-language-sites/"&gt;feincms3-language-sites&lt;/a&gt;
and also in &lt;a href="https://github.com/feincms/feincms3-sites/"&gt;feincms3-sites&lt;/a&gt; by
switching to case-insensitive matching of domain names. I have not yet added
punycode or IDNA equivalence to the code because I haven’t needed it yet and
because I’m not 100% sure how to do it without breaking anything. Even though I
often work on websites in languages with lots of accents and umlauts we don’t
use such domain names too often, so it hasn’t been a problem yet. I’ll cross
that bridge when I get there.&lt;/p&gt;
</summary></entry></feed>