From 5feb9f8528a361f6ff3586b51d9b7d235f0aef2f Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 1 Dec 2003 06:55:36 +0000 Subject: [PATCH] Add ws_getrequestheader --- src/webserver.c | 5 +++++ src/webserver.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/webserver.c b/src/webserver.c index a8deb074..3338369b 100644 --- a/src/webserver.c +++ b/src/webserver.c @@ -99,6 +99,7 @@ int ws_registerhandler(WSHANDLE ws, char *regex, int addheaders); int ws_decodepassword(char *header, char **username, char **password); int ws_testrequestheader(WS_CONNINFO *pwsc, char *header, char *value); +char *ws_getrequestheader(WS_CONNINFO *pwsc, char *header); /* * Globals @@ -1276,3 +1277,7 @@ int ws_addresponseheader(WS_CONNINFO *pwsc, char *header, char *fmt, ...) { char *ws_getvar(WS_CONNINFO *pwsc, char *var) { return ws_getarg(&pwsc->request_vars,var); } + +char *ws_getrequestheader(WS_CONNINFO *pwsc, char *header) { + return ws_getarg(&pwsc->request_headers,header); +} diff --git a/src/webserver.h b/src/webserver.h index 0ff48991..707315dd 100644 --- a/src/webserver.h +++ b/src/webserver.h @@ -82,6 +82,7 @@ extern int ws_returnerror(WS_CONNINFO *pwsc, int error, char *description); extern int ws_addresponseheader(WS_CONNINFO *pwsc, char *header, char *fmt, ...); extern int ws_writefd(WS_CONNINFO *pwsc, char *fmt, ...); extern char *ws_getvar(WS_CONNINFO *pwsc, char *var); +extern char *ws_getrequestheader(WS_CONNINFO *pwsc, char *header); extern int ws_testrequestheader(WS_CONNINFO *pwsc, char *header, char *value); #endif /* _WEBSERVER_H_ */