summaryrefslogtreecommitdiff
path: root/rc/bin/rc-httpd/handlers/authorize
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-14 01:02:43 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-14 01:02:43 +0100
commit8ef66ca21218af00181bf78f37a5ede0238a7fa1 (patch)
tree3f5dff0cd69f235340a6339fa86a7e9b54230835 /rc/bin/rc-httpd/handlers/authorize
parent060e69b15aae22ca9fcf9d9e7970bd2d611544f3 (diff)
downloadplan9front-8ef66ca21218af00181bf78f37a5ede0238a7fa1.tar.xz
rc-httpd: support for http basic authentication, fix cgi support to work with hgweb.cgi
Diffstat (limited to 'rc/bin/rc-httpd/handlers/authorize')
-rwxr-xr-xrc/bin/rc-httpd/handlers/authorize6
1 files changed, 6 insertions, 0 deletions
diff --git a/rc/bin/rc-httpd/handlers/authorize b/rc/bin/rc-httpd/handlers/authorize
new file mode 100755
index 000000000..ea4db3ef7
--- /dev/null
+++ b/rc/bin/rc-httpd/handlers/authorize
@@ -0,0 +1,6 @@
+#!/bin/rc
+if(~ $REMOTE_USER ''){
+ extra_headers=($extra_headers 'WWW-Authenticate: Basic realm="'$"SERVER_NAME'"')
+ error 401
+ exit
+}