Sha256: b202c3d77d4888ae3bf0eb09aacc462ea3ccea085e8d00b514258bf2c65e9b8d

Contents?: true

Size: 316 Bytes

Versions: 22

Compression:

Stored size: 316 Bytes

Contents

require 'rest-core/middleware'

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

  def call env
    if env[REQUEST_PATH].to_s.start_with?('http')
      app.call(env)
    else
      app.call(env.merge(REQUEST_PATH => "#{site(env)}#{env[REQUEST_PATH]}"))
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rest-core-1.0.3 lib/rest-core/middleware/default_site.rb
rest-core-1.0.2 lib/rest-core/middleware/default_site.rb
rest-core-1.0.1 lib/rest-core/middleware/default_site.rb
rest-core-1.0.0 lib/rest-core/middleware/default_site.rb
rest-core-0.8.2 lib/rest-core/middleware/default_site.rb
rest-core-0.8.1 lib/rest-core/middleware/default_site.rb
rest-core-0.8.0 lib/rest-core/middleware/default_site.rb
rest-core-0.7.2 lib/rest-core/middleware/default_site.rb
rest-core-0.7.0 lib/rest-core/middleware/default_site.rb
rest-core-0.4.0 lib/rest-core/middleware/default_site.rb
rest-core-0.4.0.pre.2 lib/rest-core/middleware/default_site.rb
rest-core-0.4.0.pre.1 lib/rest-core/middleware/default_site.rb
rest-core-0.4.0.pre.0 lib/rest-core/middleware/default_site.rb
rest-core-0.3.0 lib/rest-core/middleware/default_site.rb
rest-core-0.3.0.pre.2 lib/rest-core/middleware/default_site.rb
rest-core-0.3.0.pre.1 lib/rest-core/middleware/default_site.rb
rest-core-0.3.0.pre.0 lib/rest-core/middleware/default_site.rb
rest-core-0.2.3 lib/rest-core/middleware/default_site.rb
rest-core-0.2.2 lib/rest-core/middleware/default_site.rb
rest-core-0.2.1 lib/rest-core/middleware/default_site.rb