Thanks for the steps. Here’s a fix:
https://github.com/discourse/discourse/commit/7e97724341f41c6188667f4312eea221c0fb6e10