From a646a024d98f660f32991baa532bcbae1eceec60 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Wed, 15 Aug 2012 22:46:49 -0400 Subject: [PATCH] added 'Pragma: no-cache' header --- extras/myip/myip.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extras/myip/myip.c b/extras/myip/myip.c index 8546ef2a..84ba0d9b 100644 --- a/extras/myip/myip.c +++ b/extras/myip/myip.c @@ -14,9 +14,16 @@ int main(void) char *ip_str = NULL; if ((ip_str = getenv("REMOTE_ADDR")) != NULL) - printf("Content-Type: text/html;\r\n\r\n%s\r\n", ip_str); + fprintf(stdout, + "Pragma: no-cache\r\n" + "Content-Type: text/plain\r\n\r\n%s\r\n", + ip_str + ); else - printf("Content-Type: text/html;\r\n\r\nNULL\r\n"); + fprintf(stdout, + "Pragma: no-cache\r\n" + "Content-Type: text/plain\r\n\r\nNULL\r\n" + ); return 0; }