This is now fixed here
https://github.com/discourse/discourse/commit/691edc16c9e2a1195b4b726f5623e14ce168214b