This commit should fix the issue
https://github.com/discourse/discourse/commit/2909e7fbdf7faecc4316e235bf8018b2d48c98a9