# HG changeset patch # User Nicolas Cedilnik # Date 1519144217 -3600 # Node ID 5ca6d53d3186f2a7a59b504dd9ec6a642cf8957e # Parent 88b16084eda7de3e2f8c50cdd09fe57d3d97d311 Return 401 with correct realm when no user/pass is provided diff -r 88b16084eda7 -r 5ca6d53d3186 mod_http_auth_check/mod_http_auth_check.lua --- a/mod_http_auth_check/mod_http_auth_check.lua Tue Feb 20 14:59:03 2018 +0000 +++ b/mod_http_auth_check/mod_http_auth_check.lua Tue Feb 20 17:30:17 2018 +0100 @@ -14,7 +14,8 @@ local response = event.response; local headers = request.headers; if not headers.authorization then - return 400 + response.headers.www_authenticate = ("Basic realm=%q"):format(realm); + return 401 end local from_jid, password = b64_decode(headers.authorization:match"[^ ]*$"):match"([^:]*):(.*)"; from_jid = jid_prep(from_jid);