Sha256: a3b972660d929a57b41e4977af0ea5c051ca107de2f80b64f29e56a0620543bc

Contents?: true

Size: 891 Bytes

Versions: 7

Compression:

Stored size: 891 Bytes

Contents

require 'yaml'
require 'sinatra'
require 'sinatra/streaming'

get '/param/:value' do |value|
    { 'param' => value }.to_yaml
end

get '/name1/:value1/name2/:value2' do |value1, value2|
    { 'name1' => value1, 'name2' => value2 }.to_yaml
end

get '/param/:value/buffered' do |value|
    stream do |out|
        2_000.times do |i|
            out.print "Blah"
        end

        out.print 'START_PARAMS'
        out.print ({ 'param' => value }.to_yaml)
        out.print 'END_PARAMS'

        2_000.times do |i|
            out.print "Blah"
        end
    end
end

get '/param/:value/line_buffered' do |value|
    stream do |out|
        2_000.times do |i|
            out.puts "Blah"
        end

        out.puts 'START_PARAMS'
        out.puts ({ 'param' => value }.to_yaml)
        out.puts 'END_PARAMS'

        2_000.times do |i|
            out.puts "Blah"
        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/support/servers/arachni/element/link_template.rb
arachni-1.6.1.2 spec/support/servers/arachni/element/link_template.rb
arachni-1.6.1.1 spec/support/servers/arachni/element/link_template.rb
arachni-1.6.1 spec/support/servers/arachni/element/link_template.rb
arachni-1.6.0 spec/support/servers/arachni/element/link_template.rb
arachni-1.5.1 spec/support/servers/arachni/element/link_template.rb
arachni-1.5 spec/support/servers/arachni/element/link_template.rb