debian-mirror-gitlab/spec/support/shared_contexts/url_shared_context.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1 KiB
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2021-12-11 22:18:48 +05:30
RSpec.shared_context 'valid urls with CRLF' do
2022-06-21 17:19:12 +05:30
let(:valid_urls_with_crlf) do
2021-12-11 22:18:48 +05:30
[
"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
2020-03-13 15:44:24 +05:30
RSpec.shared_context 'invalid urls' do
2022-06-21 17:19:12 +05:30
let(:urls_with_crlf) do
2021-12-11 22:18:48 +05:30
[
"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"
]
2018-11-29 20:51:05 +05:30
end
end