fixes #3475 - make it possible to force the 401 status.
(cherry picked from commit 5eb2fa6ec0997b31b95d413c64c6bc3b2cfe552e)
fixes #3475 - make it possible to force the 401 status.
(cherry picked from commit 5eb2fa6ec0997b31b95d413c64c6bc3b2cfe552e)