VividCortex / siesta

Composable framework for writing HTTP handlers in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Post" chain handler behavior unclear with quit()

Preetam opened this issue · comments

The docs say...

The "post" chain runs after the main handler, whether it is skipped or not. The first handler in the "post" chain is guaranteed to run, but execution may quit anywhere else in the chain.
https://godoc.org/github.com/VividCortex/siesta#Service

I'm not sure why we only guarantee that the first one always runs. Right now, you can call the quit() function in the "pre" chain and only have the first handler of the "post" chain run. That seems odd to me, and it makes the application logic a bit weird too.

I think we should set quit to be false before this loop so that we can still guarantee that the first handler runs, but the user has more flexibility about the rest of the chain.