[erlang-questions] configure http methods in yaws

Steve Vinoski vinoski@REDACTED
Fri Feb 13 17:14:44 CET 2015

I don't recall seeing Yaws users asking for this config feature in the
past, so it's unlikely we'll add it. But what you're asking for -- a
configuration point for methods -- would be implemented much as I've shown
in my previous emails, much like a dispatchmod. The dispatchmod is as early
in the request handling process as you can get after the formation of the
#arg{}. The dispatchmod code I provided requires less configuration than
what you're showing, even for the default case, plus if having to have a
new module concerns you, the dispatch/1 function can be added to some other
existing module you already have instead.


On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu <bog495@REDACTED> wrote:

> Yes but the point is to have a default configuration that can be
> overridden by such a mechanism
> if one is configured.
> The 99 percent of cases only need a default behaviour.
> The way I see this is to have something like that (all in one):
>         mod_405=my_405_handle_module
> ....
> </LIMIT>
> in this way we can also customize the response if a method other than GET
> or POST is sent to the server
> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins <imantc@REDACTED>
> wrote:
>> > Traffic with methods not allowed should be discarded with 405
>> you see, someone else might prefer another action depending on method
>> not allowed.
>> a dedicated attribute may be convenient but then someone would ask:
>> "how do I change the response code? how do I redirect?". Current
>> approach gives you choice.
>> one of those cases when there is more than one approach, a prefers  A,
>> b prefers B. Both have a valid point.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150213/43df4d70/attachment.htm>

More information about the erlang-questions mailing list