File: url_shared_context.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (32 lines) | stat: -rw-r--r-- 1,058 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
    [
      "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