Restore UA-aware auth header advertisement
Revert accidental removal of WWW-Authenticate headers. Windows WebDAV clients receive Basic + Negotiate; all other clients receive Basic only.
This commit is contained in:
+8
-1
@@ -279,7 +279,14 @@ def _log_webdav_user_agent_once(request, user_agent: str):
|
||||
|
||||
|
||||
def _build_ua_auth_headers(request, *, include_hint=False) -> dict[str, str]:
|
||||
return {}
|
||||
user_agent = request.headers.get("user-agent", "")
|
||||
_log_webdav_user_agent_once(request, user_agent)
|
||||
if _is_windows_auth_client(user_agent):
|
||||
challenge = f'Basic realm="{_AUTH_REALM}", Negotiate'
|
||||
else:
|
||||
challenge = f'Basic realm="{_AUTH_REALM}"'
|
||||
headers = {"WWW-Authenticate": challenge}
|
||||
return headers
|
||||
|
||||
|
||||
def _cleanup_ntlm_challenges():
|
||||
|
||||
Reference in New Issue
Block a user