This commit should fix that:
https://github.com/discourse/discourse/commit/d9364a272e1b59b7d280d76898399ec14efec6f6