Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-02 21:05:16 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-02 21:05:16 +0300
commitd9f794a850202cb579b8c8e935b9e07b798ad0b6 (patch)
treec99dcb08e5e8700355f8dd0a8bcc1f9b93844fda /lib/gitlab
parent28219ea9211d6caafa34620859ff0e879ec54c12 (diff)
parent30bf2b9cc370da5936f70b827db4f53dc33d8f1f (diff)
Merge branch 'grack-auth-new-instance' into 'master'
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. See merge request !1237
Diffstat (limited to 'lib/gitlab')
-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 aa46c9a6d49..0353b3b7ed3 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