16 lines
271 B
Ruby
16 lines
271 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module HotlinkInterceptor
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
def intercept_hotlinking!
|
||
|
return render_406 if Gitlab::HotlinkingDetector.intercept_hotlinking?(request)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def render_406
|
||
|
head :not_acceptable
|
||
|
end
|
||
|
end
|