This has now been fixed
https://github.com/discourse/discourse/commit/5c3f1202cf8f78e2c4063cf53551879cb32c9572