URLs for avatars & emoticons adding :80 to the end of the domain

Quite correct, I’d initially assumed it was happening to custom avatars only, now it seems to be inconsistent. Updated issue title and detail accordingly, apologies.

Here’s an example of a user avatar failing:

https://www.mydomain.org:80/user_avatar/www.mydomain.org/username/40/615_1.png

The weird part is that some are rendering correctly, others have :80 added …

It’s seems a little bit like this resolved issue, but I do not have a port number in my DISCOURSE_HOSTNAME setting: