We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 53a8623 + 0d761af commit 8a3502eCopy full SHA for 8a3502e
2 files changed
docs/content/servers/lighttpd.md
@@ -31,6 +31,18 @@ server.error-handler = "/index.cgi"
31
alias.url = ("/echo" => "/var/www/echo.cgi")
32
```
33
34
+## Source — `index.cgi`
35
+
36
+```bash
37
+#!/bin/sh
38
+printf 'Content-Type: text/plain\r\n\r\n'
39
+if [ "$REQUEST_METHOD" = "POST" ] && [ "${CONTENT_LENGTH:-0}" -gt 0 ] 2>/dev/null; then
40
+ head -c "$CONTENT_LENGTH"
41
+else
42
+ printf 'OK'
43
+fi
44
+```
45
46
## Source — `echo.cgi`
47
48
```bash
src/Servers/LighttpdServer/index.cgi
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
printf 'Content-Type: text/plain\r\n\r\n'
3
-if [ "$REQUEST_METHOD" = "POST" ]; then
4
- cat
5
else
6
printf 'OK'
7
fi
0 commit comments