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