0

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;
}
k.k. lou
  • 1,805
  • 2
  • 13
  • 16

1 Answers1

0

I can't check the code now but my guess is that http_header() has never been used from a content-type handler (only from servlets, like done in G-WAN examples).

It may simply be that the structures allocated by http_header() are never used. While http_header() is conveniently doing the work for you, G-WAN handler examples show how to build or access the reply buffer so you can do whatever header edition you need from this point.

Gil
  • 3,279
  • 1
  • 15
  • 25