I made a html.c script as below, in .../csp folder. It should output the additional headers with the default headers. But, actually it output the default headers only.
What have I done wrong? Did I miss anything?
Or, is it a bug in G-WAN?
#include "gwan.h" // G-WAN exported functions
#define CACHE "Expires: Fri, May 02 2042 00:00:00 GMT\r\nCache-Control: max-age=99999999\r\n"
int main(int argc, char *argv[ ])
{
char cache[ ] = CACHE;
http_header(HEAD_ADD, cache, sizeof(CACHE) - 1, argv);
return 200;
}
I can't check the code now but my guess is that
http_header()has never been used from acontent-type handler(only fromservlets, like done in G-WAN examples).It may simply be that the structures allocated by
http_header()are never used. Whilehttp_header()is conveniently doing the work for you, G-WANhandlerexamples show how to build or access the reply buffer so you can do whatever header edition you need from this point.