[tests] test coverage for issues (#321, #322)
[lighttpd.git] / tests / fcgi-auth.c
blob3c7cdfdc04b27f222ab485b0a828b41086135c94
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4 #ifdef HAVE_FASTCGI_FASTCGI_H
5 #include <fastcgi/fcgi_stdio.h>
6 #else
7 #include <fcgi_stdio.h>
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
12 int main (void) {
14 while (FCGI_Accept() >= 0) {
16 /* Status: 200 OK to allow access is implied
17 * if Status header is not included in response */
19 char *p = getenv("QUERY_STRING");
20 if (p != NULL && 0 == strcmp(p, "var")) {
21 printf("Variable-X-LIGHTTPD-FCGI-AUTH: LighttpdTestContent\r\n");
22 } else if (p == NULL || 0 != strcmp(p, "ok")) {
23 printf("Status: 403 Forbidden\r\n");
26 printf("\r\n");
29 return 0;