You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/08/28 19:23:39 UTC
[incubator-openwhisk-package-alarms] branch master updated: When
auth header is missing send WWW-Authenticate header and a 401 (#87)
This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-alarms.git
The following commit(s) were added to refs/heads/master by this push:
new 5e5b57b When auth header is missing send WWW-Authenticate header and a 401 (#87)
5e5b57b is described below
commit 5e5b57b6ea2b4bdc60fdbe31499ba866d01a669c
Author: Jason Peterson <ja...@us.ibm.com>
AuthorDate: Mon Aug 28 15:23:37 2017 -0400
When auth header is missing send WWW-Authenticate header and a 401 (#87)
---
provider/lib/utils.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/provider/lib/utils.js b/provider/lib/utils.js
index 25935d0..0949ddc 100644
--- a/provider/lib/utils.js
+++ b/provider/lib/utils.js
@@ -324,7 +324,9 @@ module.exports = function(
if (utils.endpointAuth) {
if (!req.headers.authorization) {
- return utils.sendError(method, HttpStatus.BAD_REQUEST, 'Malformed request, authentication header expected', res);
+ res.set('www-authenticate', 'Basic realm="Private"');
+ res.status(HttpStatus.UNAUTHORIZED);
+ return res.send('');
}
var parts = req.headers.authorization.split(' ');
--
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].