Sha256: 86a77b053acdfdc4bbb0b71e380212ff1b75c2655c9a34244ae7c5a423e54c80

Contents?: true

Size: 363 Bytes

Versions: 37

Compression:

Stored size: 363 Bytes

Contents

module Spree
  module Core
    module Middleware
      class RedirectLegacyProductUrl
        def initialize(app)
          @app = app
        end

        def call(env)
          if env["PATH_INFO"] =~ %r{/t/.+/p/(.+)}
            return [301, {'Location'=> "/products/#{$1}" }, []]
          end
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
spree_core-1.3.5 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.4 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.3 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.5 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.1.6 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.1.5 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.4 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.2 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.0.7 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.3 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.1 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.0 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.0.rc2 lib/spree/core/middleware/redirect_legacy_product_url.rb
dup_spree_core-1.3.0.rc1 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.3.0.rc1 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.2 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.1.4 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.0 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.0.rc2 lib/spree/core/middleware/redirect_legacy_product_url.rb
spree_core-1.2.0.rc1 lib/spree/core/middleware/redirect_legacy_product_url.rb