~ubuntu-branches/ubuntu/utopic/ruby-excon/utopic

« back to all changes in this revision

Viewing changes to tests/rackups/ssl.ru

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2012-03-07 16:36:21 UTC
  • Revision ID: package-import@ubuntu.com-20120307163621-bztj2b8860dxpzs7
Tags: upstream-0.10.0
ImportĀ upstreamĀ versionĀ 0.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'openssl'
 
2
require 'sinatra'
 
3
require 'webrick'
 
4
require 'webrick/https'
 
5
 
 
6
class App < Sinatra::Base
 
7
  get('/content-length/:value') do |value|
 
8
    headers("Custom" => "Foo: bar")
 
9
    'x' * value.to_i
 
10
  end
 
11
 
 
12
  post('/body-sink') do
 
13
    request.body.read.size.to_s
 
14
  end
 
15
end
 
16
 
 
17
Rack::Handler::WEBrick.run(App, {
 
18
  :Port             => 9443,
 
19
  :SSLCertName      => [["CN", WEBrick::Utils::getservername]],
 
20
  :SSLEnable        => true,
 
21
  :SSLVerifyClient  => OpenSSL::SSL::VERIFY_NONE
 
22
})