This should do it:
https://github.com/discourse/discourse/commit/4bb8db024c247f20af9245723ebea4c474eeb16a