edicl/hunchentoot

define-easy-handler bug

Closed this issue · 6 comments

Hi,
in define-easy-handler there is the following code:
(or (eq ,acceptor-names t) (intersection ,acceptor-names (second list)))

which is quite obviously wrong, because intersection cannot be applied to T.

Thus, I would suggest the following replacement
(or (eq ,acceptor-names t) (eq (second list) t) (intersection (alexandria.0.dev:ensure-list ,acceptor-names) (alexandria.0.dev:ensure-list (second list))))))
Furthermore acceptor-names should probably be included in the once-only parameter list.
Regards,
Nicolas

When is inersection applied to T?

Hi Stas,
the bug can be triggered by loading Hunchentoot and then doing:
`(define-easy-handler (test-page :uri "/test") ())

(define-easy-handler (test-page :uri "/test" :acceptor-names '(TEST)) ())`

And you are right of course, the problem is not accessor-names being T but (second list) being T, so my code above is nonsense:-(

OK, it is not really nonsense, but one probably can drop the ensure-list.

Can you make it into a pull-request, including the test case.

OK, will try.