Skip to content
Snippets Groups Projects

Avoid instance variable re-use trouble

Merged username-removed-5302 requested to merge grack-auth-new-instance into master

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.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 require_relative 'shell_env'
2 2
3 3 module Grack
4 class AuthSpawner
5 def self.call(env)
6 # Avoid issues with instance variables in Grack::Auth persisting across
7 # requests by creating a new instance for each request.
8 Auth.new({}).call(env)
  • username-removed-444 Milestone changed to 8.0

    Milestone changed to 8.0

  • username-removed-444 Status changed to merged

    Status changed to merged

  • mentioned in commit d9f794a8

  • Nice turnaround time @jacobvosmaer :thumbsup:

  • @marin I had a rewrite of Grack::Auth without instance variables ready, and only then did I realize I should just put a wrapper in place because the rewrite was too much risk. It did not feel fast to come up with this. :)

  • Please register or sign in to reply
    Loading