How I failed to make LinkedIn fix their broken international domain URL parser

In Denmark it is possible to register domains with funny characters such as æ, ø and å. And we do. One prominent example is our national portal for booking Covid-19 tests at https://coronaprøver.dk. Wikipedia calls these beasts Internationalised domain names, so they must indeed exist.

Recently I quit my job (have a new one now, luckily) and found myself making posts on a social network known as LinkedIn to improve my prospects.

One of these posts was about about a hobby project I made called wishlist.dk, an ad free wish registry. The big player on the Danish wish registry market (what a market: it seems every novice web developer in Denmark has launched one of these) is https://ønskeskyen.dk.

What I wanted to let my network know was something like:

“I have launched wishlist.dk – a gratis, ad and surveilance free alternative to evil wish list giant ønskeskyen.dk”

– Morten Helmstedt, job seeker

Alas, LinkedIn’s URL parser breaks in many ways when trying to express your career news and feelings through internationalised domain names.

How do thee fail? Let me count the ways.

When making a post on LinkedIn with an URL, LinkedIn will try to:

  • Create a preview of the first URL in the post
  • Create a short link for all URLs in the post containing a path (e.g. https://lindkedin.com/path), not for top level domains and subdomains without a path. It will generally look like and point to something like https://lnkd.in/eCTD8Q9

Here are the bugs I noticed in action:

Posting like a sane person

Trying to post an internationalised domain name like any sane person would. Post preview fails to load. The link in the post itself works as expected, though.

Posting like a LinkedIn person

Whois’ing the “real” domain name and posting it like no true Dane would. Post preview succeeds.

Things go from bad to worse when trying to post an internationalised domain name with a path such as https://ønskeskyen.dk/text/cookies.

If I just post that URL, I get a post like this:

LinkedIn shortens the link to make it more readable and to be able to track our smallest actions on the world wide web.

What happens when I click the link is this:

INVALID REDIRECT

An error! (Invalid redirect)

My browser (Firefox) tries to GET the URL and is redirected to linkedin.com/slink:

A 301 redirect in action!

And then:

The submitted URL is stored, but the location should probably be https://%C3%B8nskeskyen.dk/text/cookies or maybe even https://xn--nskeskyen-k8a.dk/text/cookies. Who knows? It’s complicated. LinkedIn engineers should definitely look into this!

How I tried to fix this mess

Well, I contacted LinkedIn on Twitter (WHAT!), tried e-mailing their security e-mail (no reply, of course, but only e-mail I could find) and got in touch with a very understanding Member Support Consultant named Vegard who tried his/her best:

Pretty impressive response after describing the problem.

If our URL parser doesn’t work, just change your URL

But then the engineering team told me that I should just stop posting internationalised domain names to LinkedIn:

True for Chrome, not for Firefox, not from a usability perspective

I tried to have Vegard tell the engineers at LinkedIn to read up on internationalised domain names, but no such luck:

The sorry end.

THE END

An aside:

As another hobby project, I created lnk.dk, a very simple short link generator (like wish registries, it seems every aspiring web developer in Denmark has made one of these). Using Django‘s built in URLField I can validate, store and correctly redirect internationalised domain names with hardly any work at all on my part.

If only tools like that were available for the engineers at LinkedIn to use for their URL parsing and shortening…