From 85e3a094704b0250f8dd5b0801bc94473612db3e Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 30 Nov 2006 16:25:49 +0100 Subject: [PATCH] Add a stupid test script to print CGI variables set by ELinks To use it to test whether that CGI works put the following in your elinks.conf: set protocol.file.cgi.policy = 1 set protocol.file.cgi.path = "/path/to/elinks/test/cgi" Then point ELinks to the print-vars.sh script inside the CGI test directory in the ELinks source directory. --- test/cgi/print-vars.sh | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 test/cgi/print-vars.sh diff --git a/test/cgi/print-vars.sh b/test/cgi/print-vars.sh new file mode 100755 index 00000000..449dd70a --- /dev/null +++ b/test/cgi/print-vars.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Print all variables set by ELinks +# + +cat < + CGI variables + +EOF + +for var in \ + CONTENT_LENGTH \ + GATEWAY_INTERFACE \ + HTTP_ACCEPT \ + HTTP_ACCEPT_LANGUAGE \ + HTTP_CACHE_CONTROL \ + HTTP_COOKIE \ + HTTP_IF_MODIFIED_SINCE \ + HTTP_PRAGMA \ + HTTP_REFERER \ + HTTP_USER_AGENT \ + PATH_TRANSLATED \ + QUERY_STRING \ + REDIRECT_STATUS \ + REMOTE_ADDR \ + REQUEST_METHOD \ + SCRIPT_FILENAME \ + SCRIPT_NAME \ + SERVER_NAME \ + SERVER_PROTOCOL \ + SERVER_SOFTWARE; +do + eval val=$`echo $var` + echo ""; +done + +cat < + + +EOF +
$var$val