https://github.com/discourse/discourse/commit/9f127d8183ae4037fce4cd477927f1a5d50d7897
Here, this should help