diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-21 06:12:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-21 06:12:55 +0300 |
commit | b82d69110784e196facfbe3f8dfc8111393a5dac (patch) | |
tree | d0da7ee51cef64aa1256b16b19583d1f2b7624c5 /spec/support/shared_contexts/url_shared_context.rb | |
parent | 551734207fa6241cf444b1154294e9b82831ae9a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_contexts/url_shared_context.rb')
-rw-r--r-- | spec/support/shared_contexts/url_shared_context.rb | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/spec/support/shared_contexts/url_shared_context.rb b/spec/support/shared_contexts/url_shared_context.rb index f3d227b6e2b..da1d6e0049c 100644 --- a/spec/support/shared_contexts/url_shared_context.rb +++ b/spec/support/shared_contexts/url_shared_context.rb @@ -1,19 +1,32 @@ # frozen_string_literal: true +RSpec.shared_context 'valid urls with CRLF' do + let(:valid_urls_with_CRLF) do + [ + "http://example.com/pa%0dth", + "http://example.com/pa%0ath", + "http://example.com/pa%0d%0th", + "http://example.com/pa%0D%0Ath", + "http://gitlab.com/path?param=foo%0Abar", + "https://gitlab.com/path?param=foo%0Dbar", + "http://example.org:1024/path?param=foo%0D%0Abar", + "https://storage.googleapis.com/bucket/import_export_upload/import_file/57265/express.tar.gz?GoogleAccessId=hello@example.org&Signature=ABCD%0AEFGHik&Expires=1634663304" + ] + end +end + RSpec.shared_context 'invalid urls' do let(:urls_with_CRLF) do - ["http://127.0.0.1:333/pa\rth", - "http://127.0.0.1:333/pa\nth", - "http://127.0a.0.1:333/pa\r\nth", - "http://127.0.0.1:333/path?param=foo\r\nbar", - "http://127.0.0.1:333/path?param=foo\rbar", - "http://127.0.0.1:333/path?param=foo\nbar", - "http://127.0.0.1:333/pa%0dth", - "http://127.0.0.1:333/pa%0ath", - "http://127.0a.0.1:333/pa%0d%0th", - "http://127.0.0.1:333/pa%0D%0Ath", - "http://127.0.0.1:333/path?param=foo%0Abar", - "http://127.0.0.1:333/path?param=foo%0Dbar", - "http://127.0.0.1:333/path?param=foo%0D%0Abar"] + [ + "git://example.com/pa%0dth", + "git://example.com/pa%0ath", + "git://example.com/pa%0d%0th", + "http://example.com/pa\rth", + "http://example.com/pa\nth", + "http://example.com/pa\r\nth", + "http://example.com/path?param=foo\r\nbar", + "http://example.com/path?param=foo\rbar", + "http://example.com/path?param=foo\nbar" + ] end end |