File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
ruby/ql/test/library-tests/frameworks/Twirp Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11sourceTest
22| hello_world_server.rb:8:13:8:15 | req |
3+ | hello_world_server.rb:32:18:32:20 | req |
34ssrfSinkTest
45| hello_world_client.rb:6:47:6:75 | "http://localhost:8080/twirp" |
56serviceInstantiationTest
67| hello_world_server.rb:24:11:24:61 | call to new |
8+ | hello_world_server.rb:38:1:38:57 | call to new |
Original file line number Diff line number Diff line change 55
66class HelloWorldHandler
77 # test: request
8- def hello ( req , env )
8+ def hello ( req , env )
99 puts ">> Hello #{ req . name } "
1010 { message : "Hello #{ req . name } " }
1111 end
1212end
1313
1414class FakeHelloWorldHandler
1515 # test: !request
16- def hello ( req , env )
16+ def hello ( req , env )
1717 puts ">> Hello #{ req . name } "
1818 { message : "Hello #{ req . name } " }
1919 end
2020end
2121
2222handler = HelloWorldHandler . new ( )
2323# test: serviceInstantiation
24- service = Example ::HelloWorld ::HelloWorldService . new ( handler )
24+ service = Example ::HelloWorld ::HelloWorldService . new ( handler )
2525
2626path_prefix = "/twirp/" + service . full_name
2727server = WEBrick ::HTTPServer . new ( Port : 8080 )
2828server . mount path_prefix , Rack ::Handler ::WEBrick , service
2929server . start
30+
31+ class StaticHandler
32+ def self . hello ( req , env )
33+ puts ">> Hello #{ req . name } "
34+ { message : "Hello #{ req . name } " }
35+ end
36+ end
37+
38+ Example ::HelloWorld ::HelloWorldService . new ( StaticHandler )
You can’t perform that action at this time.
0 commit comments