Rack-newbie: how do i interrupt rack stack processing?

20 views
Skip to first unread message

Dan

unread,
Apr 24, 2010, 11:17:16 AM4/24/10
to Rack Development
Hello,

Currently I'm composing my very first rack-based application and after
few unsuccessful (unqualified) web searches decided to ask for
support.

My app looks like:

require '...'

use Rack::ContentLength
use My::Filter2
use My::Filter1
use My::HTTPHeaderValidator

app = Proc.new {...}

run app

Can I return response to client from `My::HTTPHeaderValidator' (in
case of unacceptable headers received) and bypass (or interrupt
execution of) My::Filter2, My::Filter3 and others?


--
Subscription settings: http://groups.google.com/group/rack-devel/subscribe?hl=en

Yehuda Katz

unread,
Apr 24, 2010, 1:19:35 PM4/24/10
to rack-devel
Just move My::HTTPHeaderValidator to the top of the stack :)

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

Dan

unread,
Apr 24, 2010, 3:01:26 PM4/24/10
to Rack Development
It works! :)

Just to clarify. In case I need to stop my app walk through stack I
should not inquire @app.call, right?

On Apr 24, 8:19 pm, Yehuda Katz <wyc...@gmail.com> wrote:
> Just move My::HTTPHeaderValidator to the top of the stack :)
>
> Yehuda Katz
> Developer | Engine Yard
> (ph) 718.877.1325
>

Magnus Holm

unread,
Apr 24, 2010, 3:10:14 PM4/24/10
to rack-...@googlegroups.com, Rack Development
Yep, that's correct :-)
Reply all
Reply to author
Forward
0 new messages