1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

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.
This commit is contained in:
Jonas Fonseca 2006-11-30 16:25:49 +01:00
parent 7e9fc6f33b
commit 85e3a09470

45
test/cgi/print-vars.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#
# Print all variables set by ELinks
#
cat <<EOF
Content-Type: text/html
<html>
<head><title>CGI variables</title></head>
<body><table>
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 "<tr><td><em>$var</em></td><td>$val</td></tr>";
done
cat <<EOF
</table>
</body>
</html>
EOF