That has been implemented. Turns out that the server already returned 403, it was just the error message.
https://github.com/discourse/discourse/pull/9894