aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnawp.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/nawp.scm b/nawp.scm
index 5bc6f07..86d683a 100755
--- a/nawp.scm
+++ b/nawp.scm
@@ -346,8 +346,14 @@
(print "If this program is called without arguments, it operates in CGI mode.\n")))
(define (main)
+ (when
+ (and
+ (get-environment-variable "GATEWAY_INTERFACE")
+ (not (null? (command-line-arguments))))
+ (http-fail 400 "Bad request.")
+ (exit 1))
(match (command-line-arguments)
- (() (when (get-environment-variable "GATEWAY_INTERFACE") (cgi-main)))
+ (() (cgi-main))
((adduser username display-name)
(add-user username (read-password "Password: ") display-name))
(everything-else (help))))