Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

ping event is not handled in server_template #47

Open
drok opened this issue Jul 27, 2022 · 0 comments
Open

ping event is not handled in server_template #47

drok opened this issue Jul 27, 2022 · 0 comments

Comments

@drok
Copy link

drok commented Jul 27, 2022

It appears that a "ping" event can be sent, with a NULL payload, and this causes the authenticate_installation(@payload) to fail:

I don't know enough about ruby or sinatra yet to mend the template myself, so how should payload-less events be handled, and specifically, how should 'ping' be handled?

127.0.0.1 - - [27/Jul/2022:07:07:40 +0000] "POST /event_handler HTTP/1.1" 200 - 0.1179
127.0.0.1 - - [27/Jul/2022:07:07:40 UTC] "POST /event_handler HTTP/1.0" 200 0
- -> /event_handler
D, [2022-07-27T07:08:29.959523 #14800] DEBUG -- : ---- received event ping
2022-07-27 07:08:29 - NoMethodError - undefined method `[]' for nil:NilClass:
        template_server.rb:127:in `authenticate_installation'
        template_server.rb:55:in `block in <class:GHAapp>'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1635:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1635:in `block in compile!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1040:in `block in process_route'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1038:in `catch'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1038:in `process_route'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:983:in `block in filter!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:983:in `each'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:983:in `filter!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1096:in `block in dispatch!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `block in invoke'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `catch'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `invoke'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1094:in `dispatch!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:924:in `block in call!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `block in invoke'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `catch'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1076:in `invoke'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:924:in `call!'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:913:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/xss_header.rb:18:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/path_traversal.rb:16:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/json_csrf.rb:26:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/base.rb:50:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/base.rb:50:in `call'
        /usr/share/gems/gems/rack-protection-2.0.4/lib/rack/protection/frame_options.rb:31:in `call'
        /usr/share/gems/gems/rack-2.0.8/lib/rack/logger.rb:15:in `call'
        /usr/share/gems/gems/rack-2.0.8/lib/rack/common_logger.rb:33:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:231:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:224:in `call'
        /usr/share/gems/gems/rack-2.0.8/lib/rack/head.rb:12:in `call'
        /usr/share/gems/gems/rack-2.0.8/lib/rack/method_override.rb:22:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/show_exceptions.rb:22:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:194:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1957:in `call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1502:in `block in call'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1729:in `synchronize'
        /usr/share/gems/gems/sinatra-2.0.4/lib/sinatra/base.rb:1502:in `call'
        /usr/share/gems/gems/rack-2.0.8/lib/rack/handler/webrick.rb:86:in `service'
        /usr/share/ruby/webrick/httpserver.rb:140:in `service'
        /usr/share/ruby/webrick/httpserver.rb:96:in `run'
        /usr/share/ruby/webrick/server.rb:307:in `block in start_thread'
127.0.0.1 - - [27/Jul/2022:07:08:29 UTC] "POST /event_handler HTTP/1.0" 500 123349
- -> /event_handler
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant