summaryrefslogtreecommitdiff
path: root/src/cgi.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2015-06-25 02:14:18 +0200
committerJoel Klinghed <the_jk@yahoo.com>2015-06-25 02:14:18 +0200
commit85adf26a787b33d69d07df0dc786516fed800e21 (patch)
tree12de4b0cae3999f3da7bbf3d21c631eecf6bf4a3 /src/cgi.cc
parent0c55606145b6c5d9a303b19b3dba4996ec3ed3a9 (diff)
Add basic auth support
Diffstat (limited to 'src/cgi.cc')
-rw-r--r--src/cgi.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cgi.cc b/src/cgi.cc
index b2467f3..ff21541 100644
--- a/src/cgi.cc
+++ b/src/cgi.cc
@@ -63,6 +63,21 @@ public:
return path ? path : "";
}
+ std::string request_uri() override {
+ auto path = getparam("REQUEST_URI");
+ return path ? path : "";
+ }
+
+ std::string remote_addr() override {
+ auto path = getparam("REMOTE_ADDR");
+ return path ? path : "";
+ }
+
+ std::string http_auth() override {
+ auto auth = getparam("HTTP_AUTHORIZATION");
+ return auth ? auth : "";
+ }
+
std::string content_type() override {
auto ct = getparam("CONTENT_TYPE");
if (!ct) return "";