You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2017/10/24 17:58:13 UTC

[whimsy] branch master updated: Avoid crash when using env.user in test mode

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new be19657  Avoid crash when using env.user in test mode
be19657 is described below

commit be1965739e446fcdc5cc44edb6023df7e1dce8dd
Author: Sebb <se...@apache.org>
AuthorDate: Tue Oct 24 18:58:10 2017 +0100

    Avoid crash when using env.user in test mode
---
 lib/whimsy/asf/rack.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/rack.rb b/lib/whimsy/asf/rack.rb
index bb12b66..78e2937 100644
--- a/lib/whimsy/asf/rack.rb
+++ b/lib/whimsy/asf/rack.rb
@@ -39,7 +39,10 @@ module ASF
       def call(env)
         authorized = ( ENV['RACK_ENV'] == 'test' )
 
-        authorized ||= ASF::Auth.decode(env).asf_committer?
+        # Must always call decode as it adds required accessors
+        person = ASF::Auth.decode(env)
+
+        authorized ||= person.asf_committer?
 
         if authorized
           @app.call(env)

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].