Sha256: abc26ab5274e32b4c5952f008602e432cffb9ffa776abb24240819d18ef40a0b

Contents?: true

Size: 588 Bytes

Versions: 13

Compression:

Stored size: 588 Bytes

Contents

module Locomotive::Steam
  module Middlewares

    # When rendering the page, the developer can stop it at anytime by
    # raising an RedirectionException exception. The exception message holds
    # the url we want the user to be redirected to.
    # This is specifically used by the authorize liquid tag.
    #
    class Redirection < ThreadSafe

      include Concerns::Helpers

      def _call
        begin
          self.next
        rescue Locomotive::Steam::RedirectionException => e
          redirect_to e.url, e.permanent ? 301 : 302
        end
      end

    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.8.0.alpha1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.7.1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.7.0 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.6.1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.6.0 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.6.0.rc1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.6.0.beta1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.5.3 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.5.2 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.5.1 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.5.0 lib/locomotive/steam/middlewares/redirection.rb
locomotivecms_steam-1.5.0.rc1 lib/locomotive/steam/middlewares/redirection.rb