[config] config options to stream request/response (#949, #376)
[lighttpd.git] / tests / fcgi-auth.c
blobd340b2e8dc6eb9e51fceab8bd77849f09fe777a3
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 <unistd.h>
11 #include <string.h>
13 int main (void) {
14 char* p;
16 while (FCGI_Accept() >= 0) {
17 /* wait for fastcgi authorizer request */
19 printf("Content-type: text/html\r\n");
21 if (((p = getenv("QUERY_STRING")) == NULL) ||
22 strcmp(p, "ok") != 0) {
23 printf("Status: 403 Forbidden\r\n\r\n");
24 } else {
25 printf("\r\n");
26 /* default Status is 200 - allow access */
29 printf("foobar\r\n");
32 return 0;