newlisp/examples/httpd-conf.lsp

18 lines
415 B
Text
Raw Permalink Normal View History

2016-06-11 17:22:37 +00:00
; 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