[hunchentoot-devel] Middleware with Hunchentoot

Robert Uhl eadmund42 at gmail.com
Fri Jul 20 20:41:29 UTC 2007


Edi Weitz <edi at agharta.de> writes:
>
>> I don't think Hunchentoot exposes a good place for this kind of
>> thing.  URL cleaning is easy enough: put it at the beginning of
>> *dispatch-table* where it'll get called early on and can rewrite
>> (request-uri).  But where would one put gzipping?  It has to do its
>> magic _after_ any handler runs, and process the handler's output.
>> It'd be nicest to specify it once, and not in every single handler's
>> code.
>
> http://weitz.de/hunchentoot/#dispatch-request

I imagine the suggested usage is something like this?

(defclass my-dispatch-table ()
  ((table :accessor table)))

(defmethod dispatch-request ((table my-dispatch-table))
  (with-cleverness
    (dispatch-request (table table))))

Cool!  Thanks much.

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
Asking a girl out is like finding sqrt(pi) using roman numerals.  --unknown




More information about the Tbnl-devel mailing list