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