That should fix it:
https://github.com/discourse/discourse/commit/b824af02d452e2d907690d1743b1b40eedb7667c