Module: Gitlab::Tracking::Helpers

Included in:
InternalEvents, ProductAnalyticsTracking, Projects::MergeRequests::DiffsController
Defined in:
lib/gitlab/tracking/helpers.rb,
lib/gitlab/tracking/helpers/weak_password_error_event.rb

Defined Under Namespace

Modules: WeakPasswordErrorEvent

Instance Method Summary collapse

Instance Method Details

#dnt_enabled?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/gitlab/tracking/helpers.rb', line 6

def dnt_enabled?
  Gitlab::Utils.to_boolean(request.headers['DNT'])
end

#trackable_html_request?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/gitlab/tracking/helpers.rb', line 10

def trackable_html_request?
  request.format.html? && !dnt_enabled?
end