Does this fix it @neil ?
https://github.com/discourse/discourse/commit/ca1609c8218f67a30f01a40a56267e65bf386815