global: fix for testing 401 after redirection

* Addresses issue with testing HTTP 401 status code after redirections
  to secure page.  (closes #1883)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>