Some specs configure it in a before filter, which is smarter and avoids this kind of confusions.