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