gitlab-org--gitlab-foss/spec/support/shared_examples/lib/gitlab/regex_shared_examples.rb

9 lines
277 B
Ruby

# frozen_string_literal: true
RSpec.shared_examples 'regex rejecting path traversal' do
it { is_expected.not_to match('a../b') }
it { is_expected.not_to match('a..%2fb') }
it { is_expected.not_to match('a%2e%2e%2fb') }
it { is_expected.not_to match('a%2e%2e/b') }
end