Hunchentoot Common Lisp
Hunchentoot साठी Common Lisp स्निपेट, जो /pixel.gif वरच्या रिक्वेस्टना empty GIF ने उत्तर देतो. GIF स्टार्टअपला एकदाच डिकोड होतो.
Hunchentoot Common Lisp
(ql:quickload '(:hunchentoot :cl-base64))
(defparameter *gif*
(cl-base64:base64-string-to-usb8-array "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="))
(hunchentoot:define-easy-handler (pixel :uri "/pixel.gif") ()
(setf (hunchentoot:content-type*) "image/gif"
(hunchentoot:header-out :cache-control) "no-store")
*gif*)
(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 8080))
आम्ही हा स्निपेट चालवला आणि त्याने परत केलेले बाइट्स तुलना करून पाहिले.
तपासा
curl -sI http://localhost:8080/pixel.gif