Sha256: 91faa82de58fa9f70ab42e17d87589269df8fe40b91408852499f09321fcf40c

Contents?: true

Size: 373 Bytes

Versions: 13

Compression:

Stored size: 373 Bytes

Contents

require 'rest-core/middleware'

class RestCore::DefaultSite
  def self.members; [:site]; end
  include RestCore::Middleware

  def call env, &k
    path = if env[REQUEST_PATH].to_s.start_with?('http')
             env[REQUEST_PATH]
           else
             "#{site(env)}#{env[REQUEST_PATH]}"
           end

    app.call(env.merge(REQUEST_PATH => path), &k)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rest-core-3.3.0 lib/rest-core/middleware/default_site.rb
rest-core-3.2.0 lib/rest-core/middleware/default_site.rb
rest-core-3.1.1 lib/rest-core/middleware/default_site.rb
rest-core-3.1.0 lib/rest-core/middleware/default_site.rb
rest-core-3.0.0 lib/rest-core/middleware/default_site.rb
rest-core-2.1.2 lib/rest-core/middleware/default_site.rb
rest-core-2.1.1 lib/rest-core/middleware/default_site.rb
rest-core-2.1.0 lib/rest-core/middleware/default_site.rb
rest-core-2.0.4 lib/rest-core/middleware/default_site.rb
rest-core-2.0.3 lib/rest-core/middleware/default_site.rb
rest-core-2.0.2 lib/rest-core/middleware/default_site.rb
rest-core-2.0.1 lib/rest-core/middleware/default_site.rb
rest-core-2.0.0 lib/rest-core/middleware/default_site.rb