Closed hellow554 closed 3 years ago
It's a good proposal but I think that falls out of scope.
You can easily wrap get and head functions into a convenience function taking bool isHead then making the appropriate decisions.
app.getOrHead with res, req, isHead
app.getOrHead
do you suggest a new method on the TemplatedApp
class, or am I misreading it?
I could add getOrHead, but there is already head and get, so I don't see why I should provide mixes of components. That is not going to scale, scope-wise. You have to do with what you have.
According to wikipedia
Currently they are two distinct listeners where I can each register a callback.
I would like to see that if no
head
callback is defined, but aget
cb, that uwebsockets calls theget
callback and throws away the body (:Maybe this one can be used with an AppOption, e.g.
redirectHeadToGet
or similar if you don't like that to happen per default.What do you think?