Commits

Anonymous committed bda7b92

Make Weblocks compatible with Hunchentoot >1.1.1.

Comments (0)

Files changed (2)

src/acceptor.lisp

 
 (export '(weblocks-acceptor))
 
-(defclass weblocks-acceptor (acceptor)
+(defclass weblocks-acceptor (#.(if (find-class 'easy-acceptor nil)
+                                 'easy-acceptor
+                                 'acceptor))
   ((session-cookie-name :type string :accessor session-cookie-name
                         :initarg :session-cookie-name
                         :initform (format nil "weblocks-~(~A~)" (gensym)))))

src/request-handler.lisp

 (in-package :weblocks)
 
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (when (find-symbol "*APPROVED-RETURN-CODES*" 'hunchentoot)
+    (pushnew 'hunchentoot-approved-return-codes *features*)))
 
 (export '(handle-client-request
           *before-ajax-complete-scripts*
           *request-timeout*
           *backtrace-on-session-init-error*
           *style-warn-on-circular-dirtying*
-          *style-warn-on-late-propagation*))
+          *style-warn-on-late-propagation*
+          #-hunchentoot-approved-return-codes
+            *approved-return-codes*))
+
+#-hunchentoot-approved-return-codes
+  (defvar *approved-return-codes* (list +http-ok+))
 
 (defvar *before-ajax-complete-scripts*)
 (setf (documentation '*before-ajax-complete-scripts* 'variable)