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
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/dirty_submit/dirty_submit_form.js6
-rw-r--r--app/controllers/repositories/git_http_controller.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/dirty_submit/dirty_submit_form.js b/app/assets/javascripts/dirty_submit/dirty_submit_form.js
index 0fcaec9531c..903c31cb0d1 100644
--- a/app/assets/javascripts/dirty_submit/dirty_submit_form.js
+++ b/app/assets/javascripts/dirty_submit/dirty_submit_form.js
@@ -1,4 +1,4 @@
-import _ from 'underscore';
+import { memoize, throttle } from 'lodash';
import $ from 'jquery';
class DirtySubmitForm {
@@ -21,8 +21,8 @@ class DirtySubmitForm {
}
registerListeners() {
- const getThrottledHandlerForInput = _.memoize(() =>
- _.throttle(event => this.updateDirtyInput(event), DirtySubmitForm.THROTTLE_DURATION),
+ const getThrottledHandlerForInput = memoize(() =>
+ throttle(event => this.updateDirtyInput(event), DirtySubmitForm.THROTTLE_DURATION),
);
const throttledUpdateDirtyInput = event => {
diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb
index 35ea77183b8..29bff3ef1e9 100644
--- a/app/controllers/repositories/git_http_controller.rb
+++ b/app/controllers/repositories/git_http_controller.rb
@@ -4,6 +4,7 @@ module Repositories
class GitHttpController < Repositories::GitHttpClientController
include WorkhorseRequest
+ before_action :snippet_request_allowed?
before_action :access_check
prepend_before_action :deny_head_requests, only: [:info_refs]
@@ -12,8 +13,6 @@ module Repositories
rescue_from Gitlab::GitAccess::ProjectCreationError, with: :render_422_with_exception
rescue_from Gitlab::GitAccess::TimeoutError, with: :render_503_with_exception
- before_action :snippet_request_allowed?
-
# GET /foo/bar.git/info/refs?service=git-upload-pack (git pull)
# GET /foo/bar.git/info/refs?service=git-receive-pack (git push)
def info_refs
@@ -121,6 +120,7 @@ module Repositories
def snippet_request_allowed?
if repo_type.snippet? && Feature.disabled?(:version_snippets, user)
+ Gitlab::AppLogger.info('Snippet access attempt with feature disabled')
render plain: 'The project you were looking for could not be found.', status: :not_found
end
end