From 88ce2f1c9449842ade27b2834a06b1b596a1bf2a Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 29 Jan 2021 15:34:36 +0100
Subject: mod_http_file_share: Indicate missing token via WWW-Authenticate
 header

---
 plugins/mod_http_file_share.lua | 1 +
 1 file changed, 1 insertion(+)

(limited to 'plugins')

diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index d960e853..65f28345 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -162,6 +162,7 @@ function handle_upload(event, path) -- PUT /upload/:slot
 	end
 	if not authz then
 		module:log("debug", "Missing or malformed Authorization header");
+		event.response.headers.www_authenticate = "Bearer";
 		return 403;
 	end
 	local authed, upload_info = jwt.verify(secret, authz);
-- 
cgit v1.2.3