Slide 40
Slide 40 text
18 def env
19 {
20 ‘PATH_INFO’ => @path || ‘/’,
21 ‘QUERY_STRING’ => @query || ‘’,
22 ‘METHOD’ => @method || ‘GET’,
23 ‘SERVER_NAME’ => ‘simple_rack_compatible_server’,
24 ‘SERVER_PORT’ => @port.to_s,
25 ‘rack.version’ => Rack::VERSION,
26 ‘rack.input’ => StringIO.new(@input || ‘’).set_encoding(‘ASCII_8BIT’),
27 ‘rack.errors’ => $stderr,
28 ‘rack.multiprocess’ => false,
29 ‘rack.multithread’ => false,
30 ‘rack.run_once’ => false,
31 ‘rack.url_scheme’ => @scheme&.downcase&.slice(/http[a-z]*/) || ‘http’
32 }
33 end
simple_rack_compatible_server.rb
3BDL-JOUΛࢀߟʹڥมΛઃఆ
ϦΫΤετ͔Βಈతʹੜͨ͠ڥม
PSσϑΥϧτ