diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-05-30 21:29:55 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-05-30 21:29:55 +0300 |
commit | deba648e38851ce0b24df94d6d24f083af0ffad4 (patch) | |
tree | ddc03683d07704cd5ff539c37a74f1a9ce3388f4 /lib | |
parent | f6ba1e081c96bd0a8c3561d92f97aa11d6688bc5 (diff) |
Revert "Merge remote-tracking branch 'dev/security-9-0' into 9-0-stable"
This reverts commit f6ba1e081c96bd0a8c3561d92f97aa11d6688bc5, reversing
changes made to 810cc51be37e03ebbe99711a53663956e4ffde8c.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/api.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 25 | ||||
-rw-r--r-- | lib/tasks/gitlab/db.rake | 2 |
3 files changed, 2 insertions, 26 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 6b78443cbcb..1bf20f76ad6 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -44,7 +44,6 @@ module API end before { allow_access_with_scope :api } - before { header['X-Frame-Options'] = 'SAMEORIGIN' } rescue_from Gitlab::Access::AccessDeniedError do rack_response({ 'message' => '403 Forbidden' }.to_json, 403) diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 2ebf4956a03..fc445ab9483 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -80,7 +80,7 @@ module Gitlab # here is based on Rails' foreign_key_name() method, which unfortunately # is private so we can't rely on it directly. def concurrent_foreign_key_name(table, column) - "fk_#{Digest::SHA256.hexdigest('#{table}_#{column}_fk').first(10)}" + "fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}" end # Long-running migrations may take more than the timeout allowed by @@ -226,29 +226,6 @@ module Gitlab raise error end end - - # This will replace the first occurance of a string in a column with - # the replacement - # On postgresql we can use `regexp_replace` for that. - # On mysql we find the location of the pattern, and overwrite it - # with the replacement - def replace_sql(column, pattern, replacement) - quoted_pattern = Arel::Nodes::Quoted.new(pattern.to_s) - quoted_replacement = Arel::Nodes::Quoted.new(replacement.to_s) - - if Database.mysql? - locate = Arel::Nodes::NamedFunction. - new('locate', [quoted_pattern, column]) - insert_in_place = Arel::Nodes::NamedFunction. - new('insert', [column, locate, pattern.size, quoted_replacement]) - - Arel::Nodes::SqlLiteral.new(insert_in_place.to_sql) - else - replace = Arel::Nodes::NamedFunction. - new("regexp_replace", [column, quoted_pattern, quoted_replacement]) - Arel::Nodes::SqlLiteral.new(replace.to_sql) - end - end end end end diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 5476438b8fa..ecf6b6e068b 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -62,7 +62,7 @@ namespace :gitlab do ref = Shellwords.escape(args[:ref]) - migrations = `git diff #{ref}.. --diff-filter=A --name-only -- db/migrate`.lines + migrations = `git diff #{ref}.. --name-only -- db/migrate`.lines .map { |file| Rails.root.join(file.strip).to_s } .select { |file| File.file?(file) } |