This issue is now fixed via:
https://github.com/discourse/discourse/commit/1708be4f27216392d429442524916bf8b6175443