From b58542eb99662f8a2840c9d3711d5e06c6438b45 Mon Sep 17 00:00:00 2001 From: KLuka Date: Thu, 3 Sep 2015 18:04:05 +0200 Subject: [PATCH] Added CGI session key in HTTP response header * Session key is returned in first HTTP response if CGI mode is used. Header filed is named 'X-ShellInABox-Session'. This can be used by some special applications that need unique token. --- shellinabox/shellinaboxd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shellinabox/shellinaboxd.c b/shellinabox/shellinaboxd.c index d1b2146..1ba2a3b 100644 --- a/shellinabox/shellinaboxd.c +++ b/shellinabox/shellinaboxd.c @@ -1372,8 +1372,9 @@ int main(int argc, char * const argv[]) { check(port = serverGetListeningPort(server)); printf("X-ShellInABox-Port: %d\r\n" "X-ShellInABox-Pid: %d\r\n" + "X-ShellInABox-Session: %s\r\n" "Content-type: text/html; charset=utf-8\r\n\r\n", - port, getpid()); + port, getpid(), cgiSessionKey); UNUSED(cgiRootSize); printfUnchecked(cgiRootStart, port, cgiSessionKey); fflush(stdout);