File: httpd-conf.lsp

package info (click to toggle)
newlisp 10.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 6,248 kB
  • sloc: ansic: 33,280; lisp: 4,181; sh: 609; makefile: 215
file content (17 lines) | stat: -rw-r--r-- 415 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; httpd-conf.lsp
;;
; filter and translate HTTP request for newLISP
;; -c or -http server modes
;; reject query commands using CGI with .exe files

(command-event (fn (s)
    (let (request s)
		(when (find "?" s) ; is this a query
			(set 'request (first (parse s "?")))
			; discover illegal extension in queries
			(when (ends-with request ".exe")
				(set 'request "GET /errorpage.html")) )
		request)
))

; eof