This has been fixed here:
https://github.com/discourse/discourse/commit/9268bb92bdcc7d6ec62e5506112542d89e836069