Sha256: 70f576d24a541144e0daf04d8903edf5dd3112283f02b8936b2321bd04a7c21f

Contents?: true

Size: 626 Bytes

Versions: 24

Compression:

Stored size: 626 Bytes

Contents

require 'sinatra'
require 'json'
require File.join(File.dirname(__FILE__), 'webrick_patch')

class Basic < Sinatra::Base
  set :environment, :production
  enable :dump_errors

  get('/content-length/:value') do |value|
    headers("Custom" => "Foo: bar")
    'x' * value.to_i
  end

  get('/headers') do
    content_type :json
    request.env.select{|key, _| key.start_with? 'HTTP_'}.to_json
  end

  post('/body-sink') do
    request.body.read.size.to_s
  end

  post('/echo') do
    echo
  end

  put('/echo') do
    echo
  end

  get('/echo dirty') do
    echo
  end

  private

  def echo
    request.body.read
  end

end

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
excon-0.64.0 tests/rackups/basic.rb
excon-0.63.0 tests/rackups/basic.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/excon-0.62.0/tests/rackups/basic.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/excon-0.62.0/tests/rackups/basic.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/excon-0.62.0/tests/rackups/basic.rb
excon-0.62.0 tests/rackups/basic.rb
excon-0.61.0 tests/rackups/basic.rb
excon-0.60.0 tests/rackups/basic.rb
excon-0.59.0 tests/rackups/basic.rb
excon-0.58.0 tests/rackups/basic.rb
excon-0.57.1 tests/rackups/basic.rb
excon-0.57.0 tests/rackups/basic.rb
excon-0.56.0 tests/rackups/basic.rb
excon-0.55.0 tests/rackups/basic.rb
excon-0.54.0 tests/rackups/basic.rb
excon-0.53.0 tests/rackups/basic.rb
excon-0.52.0 tests/rackups/basic.rb
excon-0.51.0 tests/rackups/basic.rb
excon-0.50.1 tests/rackups/basic.rb
excon-0.50.0 tests/rackups/basic.rb