Sha256: 3acdd0c69bb9f7fc1cdca0846564a6a1b9227981052b2393f7f8e901ca777ca9
Contents?: true
Size: 469 Bytes
Versions: 4
Compression:
Stored size: 469 Bytes
Contents
module Locomotive module Middlewares class SeoTrailingSlash < Base def initialize(app, opts = {}) @app = app end def call(env) request = Rack::Request.new(env) path = request.path if !is_backoffice?(request) && path.size > 1 && path.ends_with?('/') url = modify_url(request, request.path.chop) redirect_to(url) else @app.call(env) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems