summaryrefslogtreecommitdiff
path: root/data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-29 17:53:00 +0000
committerMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-29 17:53:00 +0000
commit59f5fd20e2f59ae186d5a461aef7782dd55e4e7b (patch)
tree10475faf0b6dcb812b64da679f4ae8ff01c45874 /data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c
parentf06e297cd175cca39745f6d1970225ae88aa68f1 (diff)
Updated lighttpd.
Diffstat (limited to 'data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c')
-rw-r--r--data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c b/data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c
new file mode 100644
index 000000000..3c7cdfdc0
--- /dev/null
+++ b/data/lighttpd/lighttpd-1.4.53/tests/fcgi-auth.c
@@ -0,0 +1,30 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef HAVE_FASTCGI_FASTCGI_H
+#include <fastcgi/fcgi_stdio.h>
+#else
+#include <fcgi_stdio.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+
+int main (void) {
+
+ while (FCGI_Accept() >= 0) {
+
+ /* Status: 200 OK to allow access is implied
+ * if Status header is not included in response */
+
+ char *p = getenv("QUERY_STRING");
+ if (p != NULL && 0 == strcmp(p, "var")) {
+ printf("Variable-X-LIGHTTPD-FCGI-AUTH: LighttpdTestContent\r\n");
+ } else if (p == NULL || 0 != strcmp(p, "ok")) {
+ printf("Status: 403 Forbidden\r\n");
+ }
+
+ printf("\r\n");
+ }
+
+ return 0;
+}