summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-09-02 18:47:56 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-09-02 18:47:56 +0200
commit30bf2b9cc370da5936f70b827db4f53dc33d8f1f (patch)
tree3e75d8e0ac853d35a8014581c8d554ebbbaedf8d /lib
parent308c6428aef2a46b0370a24d85a97b0e133283a8 (diff)
downloadgitlab-ce-30bf2b9cc370da5936f70b827db4f53dc33d8f1f.tar.gz
Avoid instance variable re-use trouble
This is the quickest/dumbest/safest way I could think of to prevent the instance variable reuse problems we have on dev.gitlab.org now.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/grack_auth.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index dc87aa52a3e..7ffc3226913 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -1,6 +1,14 @@
require_relative 'shell_env'
module Grack
+ class AuthSpawner
+ def self.call(env)
+ # Avoid issues with instance variables in Grack::Auth persisting across
+ # requests by creating a new instance for each request.
+ Auth.new({}).call(env)
+ end
+ end
+
class Auth < Rack::Auth::Basic
attr_accessor :user, :project, :env