[cig-commits] [commit] master: Bail out on empty payload. (510eee6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jun 4 12:49:47 PDT 2014


Repository : https://github.com/geodynamics/relax

On branch  : master
Link       : https://github.com/geodynamics/relax/compare/f824f9365a21ba8760de2e40f714706247f2a84e...5dc0660d5364cadb5bdb50a243c0bbbcfedad4e9

>---------------------------------------------------------------

commit 510eee6c65e09af7a76c6dd826261ba63516bbf5
Author: Matthias Vallentin <vallentin at icir.org>
Date:   Tue Apr 29 15:55:20 2014 -0700

    Bail out on empty payload.
    
    An empty HTTP body should not occur. There appears to be an interface or API
    change on github's side which needs to be investigated.


>---------------------------------------------------------------

510eee6c65e09af7a76c6dd826261ba63516bbf5
 gitdub | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gitdub b/gitdub
index b40e743..dd25740 100755
--- a/gitdub
+++ b/gitdub
@@ -141,7 +141,11 @@ class GitDubServer < Sinatra::Base
       return
     end
 
-    $gitdub.process(JSON.parse(params[:payload]))
+    if not params[:payload]
+      $logger.error("received POST request with empty payload")
+    else
+      $gitdub.process(JSON.parse(params[:payload]))
+    end
   end
 end
 



More information about the CIG-COMMITS mailing list