<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 12, 2014 at 3:21 PM, Stefan Hornburg (Racke) <span dir="ltr"><<a href="mailto:racke@linuxia.de" target="_blank">racke@linuxia.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/12/2014 02:35 PM, Sawyer X wrote:<br>
> Unfortunately that is a terrible example. The concept of blocking all requests in a before() hook is... let's say, naive. In reality you would like to simply block specific requests according to session, a la David Golden's Auth::Tiny.<br>
><br>
> The before hooks are basically run on every request. Static files are now served through the File handler. That means it will trigger the before hooks because it's a normal request.<br>
> I would love to do it using the Static middleware, but then it will happen before a route check on it, so we can't have that.<br>
<br>
</span>I still disagree with this change of behaviour from Dancer 1 to Dancer 2. What is the benefit of calling before hook for public files?<br>
Also in a production environment you might deliver static files with some other software (Nginx, ...) and you loose control on<br>
these public files anyway.<br></blockquote><div><br></div><div><br></div><div>The point is that this is not a selection of behavior. It isn't "we want a before hook on public files", but "because public files are serves as a handler, they will have before hooks called too". It's implicit behavior because of the restructuring of public files as file handlers.</div><div><br></div><div> </div></div></div></div>