excon 0.64.0 → 0.65.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/data/cacert.pem +108 -2
  3. data/excon.gemspec +7 -2
  4. data/lib/excon.rb +11 -11
  5. data/lib/excon/connection.rb +25 -25
  6. data/lib/excon/response.rb +1 -1
  7. data/lib/excon/version.rb +1 -1
  8. metadata +3 -101
  9. data/.document +0 -5
  10. data/.github/stale.yml +0 -17
  11. data/.gitignore +0 -13
  12. data/.rspec +0 -3
  13. data/.travis.yml +0 -17
  14. data/Gemfile +0 -19
  15. data/Rakefile +0 -41
  16. data/benchmarks/class_vs_lambda.rb +0 -50
  17. data/benchmarks/concat_vs_insert.rb +0 -21
  18. data/benchmarks/concat_vs_interpolate.rb +0 -22
  19. data/benchmarks/cr_lf.rb +0 -21
  20. data/benchmarks/downcase-eq-eq_vs_casecmp.rb +0 -169
  21. data/benchmarks/excon.rb +0 -69
  22. data/benchmarks/excon_vs.rb +0 -165
  23. data/benchmarks/for_vs_array_each.rb +0 -27
  24. data/benchmarks/for_vs_hash_each.rb +0 -27
  25. data/benchmarks/has_key-vs-lookup.rb +0 -177
  26. data/benchmarks/headers_case_sensitivity.rb +0 -83
  27. data/benchmarks/headers_split_vs_match.rb +0 -34
  28. data/benchmarks/implicit_block-vs-explicit_block.rb +0 -98
  29. data/benchmarks/merging.rb +0 -21
  30. data/benchmarks/single_vs_double_quotes.rb +0 -21
  31. data/benchmarks/string_ranged_index.rb +0 -87
  32. data/benchmarks/strip_newline.rb +0 -115
  33. data/benchmarks/vs_stdlib.rb +0 -82
  34. data/changelog.txt +0 -1113
  35. data/spec/excon/error_spec.rb +0 -139
  36. data/spec/excon/test/server_spec.rb +0 -28
  37. data/spec/excon_spec.rb +0 -7
  38. data/spec/helpers/file_path_helpers.rb +0 -22
  39. data/spec/helpers/warning_helpers.rb +0 -9
  40. data/spec/requests/basic_spec.rb +0 -40
  41. data/spec/requests/eof_requests_spec.rb +0 -36
  42. data/spec/requests/unix_socket_spec.rb +0 -38
  43. data/spec/requests/validation_spec.rb +0 -80
  44. data/spec/spec_helper.rb +0 -26
  45. data/spec/support/shared_contexts/test_server_context.rb +0 -83
  46. data/spec/support/shared_contexts/test_stub_context.rb +0 -11
  47. data/spec/support/shared_examples/shared_example_for_clients.rb +0 -220
  48. data/spec/support/shared_examples/shared_example_for_streaming_clients.rb +0 -20
  49. data/spec/support/shared_examples/shared_example_for_test_servers.rb +0 -16
  50. data/tests/authorization_header_tests.rb +0 -27
  51. data/tests/bad_tests.rb +0 -69
  52. data/tests/basic_tests.rb +0 -351
  53. data/tests/batch_requests.rb +0 -133
  54. data/tests/complete_responses.rb +0 -31
  55. data/tests/data/127.0.0.1.cert.crt +0 -17
  56. data/tests/data/127.0.0.1.cert.key +0 -28
  57. data/tests/data/excon.cert.crt +0 -17
  58. data/tests/data/excon.cert.key +0 -28
  59. data/tests/data/xs +0 -1
  60. data/tests/error_tests.rb +0 -145
  61. data/tests/header_tests.rb +0 -119
  62. data/tests/instrumentors/logging_instrumentor_tests.rb +0 -28
  63. data/tests/middleware_tests.rb +0 -27
  64. data/tests/middlewares/canned_response_tests.rb +0 -34
  65. data/tests/middlewares/capture_cookies_tests.rb +0 -34
  66. data/tests/middlewares/decompress_tests.rb +0 -157
  67. data/tests/middlewares/escape_path_tests.rb +0 -36
  68. data/tests/middlewares/idempotent_tests.rb +0 -245
  69. data/tests/middlewares/instrumentation_tests.rb +0 -315
  70. data/tests/middlewares/mock_tests.rb +0 -304
  71. data/tests/middlewares/redirect_follower_tests.rb +0 -112
  72. data/tests/pipeline_tests.rb +0 -40
  73. data/tests/proxy_tests.rb +0 -306
  74. data/tests/query_string_tests.rb +0 -87
  75. data/tests/rackups/basic.rb +0 -41
  76. data/tests/rackups/basic.ru +0 -3
  77. data/tests/rackups/basic_auth.ru +0 -14
  78. data/tests/rackups/deflater.ru +0 -4
  79. data/tests/rackups/proxy.ru +0 -18
  80. data/tests/rackups/query_string.ru +0 -13
  81. data/tests/rackups/redirecting.ru +0 -23
  82. data/tests/rackups/redirecting_with_cookie.ru +0 -40
  83. data/tests/rackups/request_headers.ru +0 -15
  84. data/tests/rackups/request_methods.ru +0 -21
  85. data/tests/rackups/response_header.ru +0 -18
  86. data/tests/rackups/ssl.ru +0 -16
  87. data/tests/rackups/ssl_mismatched_cn.ru +0 -15
  88. data/tests/rackups/ssl_verify_peer.ru +0 -16
  89. data/tests/rackups/streaming.ru +0 -30
  90. data/tests/rackups/thread_safety.ru +0 -17
  91. data/tests/rackups/timeout.ru +0 -14
  92. data/tests/rackups/webrick_patch.rb +0 -34
  93. data/tests/request_headers_tests.rb +0 -21
  94. data/tests/request_method_tests.rb +0 -47
  95. data/tests/request_tests.rb +0 -58
  96. data/tests/response_tests.rb +0 -197
  97. data/tests/servers/bad.rb +0 -25
  98. data/tests/servers/eof.rb +0 -17
  99. data/tests/servers/error.rb +0 -20
  100. data/tests/servers/good.rb +0 -342
  101. data/tests/servers/good_ipv4.rb +0 -8
  102. data/tests/servers/good_ipv6.rb +0 -8
  103. data/tests/test_helper.rb +0 -297
  104. data/tests/thread_safety_tests.rb +0 -39
  105. data/tests/timeout_tests.rb +0 -12
  106. data/tests/utils_tests.rb +0 -81
@@ -1,133 +0,0 @@
1
- require 'shindo'
2
-
3
- Shindo.tests('Batch Requests') do
4
- with_server('good_ipv4') do
5
- tests('with batch request size 2') do
6
- returns(%w{ 1 2 1 2 }, 'batch request size 2') do
7
- connection = Excon.new('http://127.0.0.1:9292')
8
-
9
- ret = []
10
- ret << connection.batch_requests([
11
- {:method => :get, :path => '/echo/request_count'},
12
- {:method => :get, :path => '/echo/request_count'},
13
- {:method => :get, :path => '/echo/request_count'},
14
- {:method => :get, :path => '/echo/request_count'}
15
- ], 2).map(&:body)
16
-
17
- ret.flatten
18
- end
19
- end
20
-
21
- tests('peristent with batch request size 2') do
22
- returns(%w{ 1 2 3 4 }, 'persistent batch request size 2') do
23
- connection = Excon.new('http://127.0.0.1:9292', :persistent => true)
24
-
25
- ret = []
26
- ret << connection.batch_requests([
27
- {:method => :get, :path => '/echo/request_count'},
28
- {:method => :get, :path => '/echo/request_count'},
29
- {:method => :get, :path => '/echo/request_count'},
30
- {:method => :get, :path => '/echo/request_count'}
31
- ], 2).map(&:body)
32
-
33
- ret.flatten
34
- end
35
- end
36
-
37
- tests('with batch request size 3') do
38
- returns(%w{ 1 2 3 1 }, 'batch request size 3') do
39
- connection = Excon.new('http://127.0.0.1:9292')
40
-
41
- ret = []
42
- ret << connection.batch_requests([
43
- {:method => :get, :path => '/echo/request_count'},
44
- {:method => :get, :path => '/echo/request_count'},
45
- {:method => :get, :path => '/echo/request_count'},
46
- {:method => :get, :path => '/echo/request_count'}
47
- ], 3).map(&:body)
48
-
49
- ret.flatten
50
- end
51
- end
52
-
53
- tests('persistent with batch request size 3') do
54
- returns(%w{ 1 2 3 4 }, 'persistent batch request size 3') do
55
- connection = Excon.new('http://127.0.0.1:9292', :persistent => true)
56
-
57
- ret = []
58
- ret << connection.batch_requests([
59
- {:method => :get, :path => '/echo/request_count'},
60
- {:method => :get, :path => '/echo/request_count'},
61
- {:method => :get, :path => '/echo/request_count'},
62
- {:method => :get, :path => '/echo/request_count'}
63
- ], 3).map(&:body)
64
-
65
- ret.flatten
66
- end
67
- end
68
-
69
- tests('with batch request size 4') do
70
- returns(%w{ 1 2 3 4 }, 'batch request size 4') do
71
- connection = Excon.new('http://127.0.0.1:9292')
72
-
73
- ret = []
74
- ret << connection.batch_requests([
75
- {:method => :get, :path => '/echo/request_count'},
76
- {:method => :get, :path => '/echo/request_count'},
77
- {:method => :get, :path => '/echo/request_count'},
78
- {:method => :get, :path => '/echo/request_count'}
79
- ], 4).map(&:body)
80
-
81
- ret.flatten
82
- end
83
- end
84
-
85
- tests('persistent with batch request size 4') do
86
- returns(%w{ 1 2 3 4 }, 'persistent batch request size 4') do
87
- connection = Excon.new('http://127.0.0.1:9292', :persistent => true)
88
-
89
- ret = []
90
- ret << connection.batch_requests([
91
- {:method => :get, :path => '/echo/request_count'},
92
- {:method => :get, :path => '/echo/request_count'},
93
- {:method => :get, :path => '/echo/request_count'},
94
- {:method => :get, :path => '/echo/request_count'}
95
- ], 4).map(&:body)
96
-
97
- ret.flatten
98
- end
99
- end
100
-
101
- tests('with batch request size 8') do
102
- returns(%w{ 1 2 3 4 }, 'batch request size 8') do
103
- connection = Excon.new('http://127.0.0.1:9292')
104
-
105
- ret = []
106
- ret << connection.batch_requests([
107
- {:method => :get, :path => '/echo/request_count'},
108
- {:method => :get, :path => '/echo/request_count'},
109
- {:method => :get, :path => '/echo/request_count'},
110
- {:method => :get, :path => '/echo/request_count'}
111
- ], 8).map(&:body)
112
-
113
- ret.flatten
114
- end
115
- end
116
-
117
- tests('persistent with batch request size 8') do
118
- returns(%w{ 1 2 3 4 }, 'persistent batch request size 8') do
119
- connection = Excon.new('http://127.0.0.1:9292', :persistent => true)
120
-
121
- ret = []
122
- ret << connection.batch_requests([
123
- {:method => :get, :path => '/echo/request_count'},
124
- {:method => :get, :path => '/echo/request_count'},
125
- {:method => :get, :path => '/echo/request_count'},
126
- {:method => :get, :path => '/echo/request_count'}
127
- ], 8).map(&:body)
128
-
129
- ret.flatten
130
- end
131
- end
132
- end
133
- end
@@ -1,31 +0,0 @@
1
- Shindo.tests('Excon Response Validation') do
2
- env_init
3
-
4
- with_server('good_ipv4') do
5
- tests('good responses with complete headers') do
6
- 100.times do
7
- res = Excon.get('http://127.0.0.1:9292/chunked/simple')
8
- returns(true) { res.body == "hello world" }
9
- returns(true) { res.status_line == "HTTP/1.1 200 OK\r\n" }
10
- returns(true) { res.status == 200}
11
- returns(true) { res.reason_phrase == "OK" }
12
- returns(true) { res.remote_ip == "127.0.0.1" }
13
- end
14
- end
15
- end
16
-
17
- with_server('error') do
18
- tests('error responses with complete headers') do
19
- 100.times do
20
- res = Excon.get('http://127.0.0.1:9292/error/not_found')
21
- returns(true) { res.body == "server says not found" }
22
- returns(true) { res.status_line == "HTTP/1.1 404 Not Found\r\n" }
23
- returns(true) { res.status == 404}
24
- returns(true) { res.reason_phrase == "Not Found" }
25
- returns(true) { res.remote_ip == "127.0.0.1" }
26
- end
27
- end
28
- end
29
-
30
- env_restore
31
- end
@@ -1,17 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIICxDCCAawCCQC/zVG+jqJ/tzANBgkqhkiG9w0BAQsFADAkMRIwEAYDVQQDDAkx
3
- MjcuMC4wLjExDjAMBgNVBAoMBWV4Y29uMB4XDTE5MDQxMjE0MzE1N1oXDTIwMDQx
4
- MTE0MzE1N1owJDESMBAGA1UEAwwJMTI3LjAuMC4xMQ4wDAYDVQQKDAVleGNvbjCC
5
- ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJzEs8Gufig6OdBAaKeit5Gn
6
- OXFTirbcLjhSfyowdTFCY+BRYhircz8ITTf6hPqyKIXV6LCS2/SHHUihwS6fB7u/
7
- ZhmcBkWC7mkFkWgq41LcPLscAn0aOq2/AgIHYUEFg6svSb+H4oWZIgpgaNGL/0BR
8
- 5PJKZkDtNOIL/fnkCMv2TTz1dnK7nu4z8XZ/iPXE0Fok20r7Ka1j8bEgsUffAWlA
9
- QAR+0SfHGkr/uFFA3rzRiajSWI+OcCYlcowTWehNNRlLtkMcWe3dcnQ+OZraJoe7
10
- PgyGQ6e+dLkLARn9jihmKzLnQrWf2VBAifknmMDoK5iv81z6zJOnUpruCXRBXd0C
11
- AwEAATANBgkqhkiG9w0BAQsFAAOCAQEAiwIgluZ8Rts3ga07CugZACTGVap6LUVW
12
- 0RoJ2zFzkc0msI/i5I/5X/cz1DqV7f1MjhXTQlY3aO6zzJWfuZRLF3tu81oVO5VG
13
- /lnNqklPBGzPmeq/dR4o9bm9aJvQy74uD3lqbb8uEvrpsjqDUUawm/jt6YLevC6M
14
- lNa3dWupQb30eGUeJkfuHT4cpOwLKdWM2xfLtwNY0QiR2i1UkvCOO16vBl+Wf4Uc
15
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jEOMAwGA1UECgwFZXhjb24wggEiMA0GCSqG
5
- SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCycrlh3FfPSv8kDJrvnRJwdFPUp+23juTD
6
- Pb8A7YBM1rw/z5WKJGhmdYAnhyhSO5KWuKH4dUTykNn0uFz0J5bXKclU6kjatM58
7
- IF96tc7kugDXCy+IBnmf2pM2fDrmji0c50abcHu70HQvxC+BQS9Id0iZ2G12q539
8
- lgxvSAquyh9NBhHhxW7aNUvPuueUVlfIKshd50aHtxWlMxr9hvOZzldj9C38du0Y
9
- uY+klTReMY2UCK2cm9S31QSP4gSeepGeaw6buV5pGNhiK9UR6dVVF4qFu21ZE0aN
10
- pNlCaBK8zCT5toxkgca096cKFOY6nfrhzhDdd2ULlRc/zpAkYuVRAgMBAAEwDQYJ
11
- KoZIhvcNAQELBQADggEBAIaZW9JnfhFhnq6bu0qo0HFrfEnpOhiMHIp2nyAoXdQI
12
- k/3Dxfd17LmfonQDkwo0D+tp3yu7xL2+qVIPElyWmKnhF13U4lhiGhAbMopV1dSH
13
- oUU5uk3DHfeWcTurC9PMX5MnozIaogmffkTEhXBOdaNI6vfk2Gs0tqYMGyIV2VNp
14
- KMegKCP2gX+PbqzXq6DzVCxbeDGdjKxpFQqas1W+soL/I9Hg7w/S8W9SpNP0tsfd
15
- JB7Xl2urXNK8HnsRt9uhwP6ZSIdtVqr62CqM2z0SvuTTdPTDn2TMGd0nHacpmqN0
16
- vUHeoZheUD+w8SikrQnr4/Ft3JrH0SKY0FlgVIGcaPg=
17
- -----END CERTIFICATE-----
@@ -1,28 +0,0 @@
1
- -----BEGIN PRIVATE KEY-----
2
- MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCycrlh3FfPSv8k
3
- DJrvnRJwdFPUp+23juTDPb8A7YBM1rw/z5WKJGhmdYAnhyhSO5KWuKH4dUTykNn0
4
- uFz0J5bXKclU6kjatM58IF96tc7kugDXCy+IBnmf2pM2fDrmji0c50abcHu70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G4v/Lc+M/j7NpnUNmQraii2
21
- tUhhPmYo1O8Og+GCemlcuaOXVZssCbUeLi2YN1HKtmXoZ7pdcgqMWMshAoGAFZCZ
22
- dsuudIVnoHQzJlxzBhyS+sH4dPSWXY9JDhn3z1cbFZ2FQqOQnBzx4KCAtwDzo/Bi
23
- Ow3OnDrBPiue0cMDsKvzi5EgUZoUMchDoxN4nnCcY74H+wmGERck9sgQKKIsC10h
24
- +eRMD6VlLqPP82m7kTwNySKpGuUeR88X0XZnGgsCgYB26Hpm7rUJY/sUCyEQxqW+
25
- Opt8vOBV0ipapFD7O7VKImz7wALKBs6oiQGr+AoN/YavIYbubnmzP8jSUoqeWzFR
26
- c4s3/sozur+1sbFqk/lJeSdvogY2CT4qgQx9OrZBynSWYldHig9HEeU5a56oh9vv
27
- Vns6XV2XQMGmvjg9yetRig==
28
- -----END PRIVATE KEY-----
@@ -1 +0,0 @@
1
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -1,145 +0,0 @@
1
-
2
-
3
- Shindo.tests('HTTPStatusError request/response debugging') do
4
-
5
- # Regression against e300458f2d9330cb265baeb8973120d08c665d9
6
- tests('Excon::Error knows about pertinent errors') do
7
- expected = [
8
- 100,
9
- 101,
10
- (200..206).to_a,
11
- (300..307).to_a,
12
- (400..417).to_a,
13
- 422,
14
- 429,
15
- (500..504).to_a
16
- ]
17
- expected.flatten == Excon::Error.status_errors.keys
18
- end
19
-
20
- tests('new returns an Error').returns(true) do
21
- Excon::Error.new('bar').class == Excon::Error
22
- end
23
-
24
- tests('new raises errors for bad URIs').returns(true) do
25
- begin
26
- Excon.new('foo')
27
- false
28
- rescue => err
29
- err.to_s.include? 'foo'
30
- end
31
- end
32
-
33
- tests('new raises errors for bad paths').returns(true) do
34
- begin
35
- Excon.new('http://localhost', path: "foo\r\nbar: baz")
36
- false
37
- rescue => err
38
- err.to_s.include?(RUBY_VERSION >= '2.6.0' ? 'foo\r\nbar: baz' : "foo\r\nbar: baz")
39
- end
40
- end
41
-
42
- tests('can raise standard error and catch standard error').returns(true) do
43
- begin
44
- raise Excon::Error::Client.new('foo')
45
- rescue Excon::Error => e
46
- true
47
- end
48
- end
49
-
50
- tests('can raise legacy errors and catch legacy errors').returns(true) do
51
- begin
52
- raise Excon::Errors::Error.new('bar')
53
- rescue Excon::Errors::Error => e
54
- true
55
- end
56
- end
57
-
58
- tests('can raise standard error and catch legacy errors').returns(true) do
59
- begin
60
- raise Excon::Error::NotFound.new('bar')
61
- rescue Excon::Errors::Error => e
62
- true
63
- end
64
- end
65
-
66
- tests('can raise with status_error() and catch with standard error').returns(true) do
67
- begin
68
- raise Excon::Error.status_error({expects: 200}, {status: 400})
69
- rescue Excon::Error
70
- true
71
- end
72
- end
73
-
74
-
75
- tests('can raise with status_error() and catch with legacy error').returns(true) do
76
- begin
77
- raise Excon::Error.status_error({expects: 200}, {status: 400})
78
- rescue Excon::Errors::BadRequest
79
- true
80
- end
81
- end
82
-
83
- tests('can raise with legacy status_error() and catch with legacy').returns(true) do
84
- begin
85
- raise Excon::Errors.status_error({expects: 200}, {status: 400})
86
- rescue Excon::Errors::BadRequest
87
- true
88
- end
89
- end
90
-
91
-
92
- tests('can raise with legacy status_error() and catch with standard').returns(true) do
93
- begin
94
- raise Excon::Errors.status_error({expects: 200}, {status: 400})
95
- rescue Excon::Error
96
- true
97
- end
98
- end
99
-
100
- with_server('error') do
101
-
102
- tests('message does not include response or response info').returns(true) do
103
- begin
104
- Excon.get('http://127.0.0.1:9292/error/not_found', :expects => 200)
105
- rescue Excon::Errors::HTTPStatusError => err
106
- err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
107
- !err.message.include?('excon.error.request') &&
108
- !err.message.include?('excon.error.response')
109
- end
110
- end
111
-
112
- tests('message includes only request info').returns(true) do
113
- begin
114
- Excon.get('http://127.0.0.1:9292/error/not_found', :expects => 200,
115
- :debug_request => true)
116
- rescue Excon::Errors::HTTPStatusError => err
117
- err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
118
- err.message.include?('excon.error.request') &&
119
- !err.message.include?('excon.error.response')
120
- end
121
- end
122
-
123
- tests('message includes only response info').returns(true) do
124
- begin
125
- Excon.get('http://127.0.0.1:9292/error/not_found', :expects => 200,
126
- :debug_response => true)
127
- rescue Excon::Errors::HTTPStatusError => err
128
- err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
129
- !err.message.include?('excon.error.request') &&
130
- err.message.include?('excon.error.response')
131
- end
132
- end
133
-
134
- tests('message include request and response info').returns(true) do
135
- begin
136
- Excon.get('http://127.0.0.1:9292/error/not_found', :expects => 200,
137
- :debug_request => true, :debug_response => true)
138
- rescue Excon::Errors::HTTPStatusError => err
139
- err.message.include?('Expected(200) <=> Actual(404 Not Found)') &&
140
- err.message.include?('excon.error.request') &&
141
- err.message.include?('excon.error.response')
142
- end
143
- end
144
- end
145
- end
@@ -1,119 +0,0 @@
1
- Shindo.tests('Excon response header support') do
2
- env_init
3
-
4
- tests('Excon::Headers storage') do
5
- headers = Excon::Headers.new
6
- headers['Exact-Case'] = 'expected'
7
- headers['Another-Fixture'] = 'another'
8
-
9
- tests('stores and retrieves as received').returns('expected') do
10
- headers['Exact-Case']
11
- end
12
-
13
- tests('enumerates keys as received') do
14
- ks = headers.keys
15
- tests('contains Exact-Case').returns(true) { ks.include? 'Exact-Case' }
16
- tests('contains Another-Fixture').returns(true) { ks.include? 'Another-Fixture' }
17
- end
18
-
19
- tests('supports case-insensitive access').returns('expected') do
20
- headers['EXACT-CASE']
21
- end
22
-
23
- tests('but still returns nil for missing keys').returns(nil) do
24
- headers['Missing-Header']
25
- end
26
-
27
- tests('Hash methods that should support case-insensitive access') do
28
- if {}.respond_to? :assoc
29
- tests('#assoc').returns(%w{exact-case expected}) do
30
- headers.assoc('exact-Case')
31
- end
32
- end
33
-
34
- tests('#delete') do
35
- tests('with just a key').returns('yes') do
36
- headers['Extra'] = 'yes'
37
- headers.delete('extra')
38
- end
39
-
40
- tests('with a proc').returns('called with notpresent') do
41
- headers.delete('notpresent') { |k| "called with #{k}" }
42
- end
43
- end
44
-
45
- tests('#fetch') do
46
- tests('when present').returns('expected') { headers.fetch('exact-CASE') }
47
- tests('with a default value').returns('default') { headers.fetch('missing', 'default') }
48
- tests('with a default proc').returns('got missing') do
49
- headers.fetch('missing') { |k| "got #{k}" }
50
- end
51
- end
52
-
53
- tests('#has_key?') do
54
- tests('when present').returns(true) { headers.has_key?('EXACT-case') }
55
- tests('when absent').returns(false) { headers.has_key?('missing') }
56
- end
57
-
58
- tests('#values_at') do
59
- tests('all present').returns(%w{expected another}) do
60
- headers.values_at('exACT-cASE', 'anotheR-fixturE')
61
- end
62
- tests('some missing').returns(['expected', nil]) do
63
- headers.values_at('exact-case', 'missing-header')
64
- end
65
- end
66
- end
67
- end
68
-
69
- with_rackup('response_header.ru') do
70
-
71
- tests('Response#get_header') do
72
- connection = nil
73
- response = nil
74
-
75
- tests('with variable header capitalization') do
76
-
77
- tests('response.get_header("mixedcase-header")').returns('MixedCase') do
78
- connection = Excon.new('http://foo.com:8080', :proxy => 'http://127.0.0.1:9292')
79
- response = connection.request(:method => :get, :path => '/foo')
80
-
81
- response.get_header("mixedcase-header")
82
- end
83
-
84
- tests('response.get_header("uppercase-header")').returns('UPPERCASE') do
85
- response.get_header("uppercase-header")
86
- end
87
-
88
- tests('response.get_header("lowercase-header")').returns('lowercase') do
89
- response.get_header("lowercase-header")
90
- end
91
-
92
- end
93
-
94
- tests('when provided key capitalization varies') do
95
-
96
- tests('response.get_header("MIXEDCASE-HEADER")').returns('MixedCase') do
97
- response.get_header("MIXEDCASE-HEADER")
98
- end
99
-
100
- tests('response.get_header("MiXeDcAsE-hEaDeR")').returns('MixedCase') do
101
- response.get_header("MiXeDcAsE-hEaDeR")
102
- end
103
-
104
- end
105
-
106
- tests('when header is unavailable') do
107
-
108
- tests('response.get_header("missing")').returns(nil) do
109
- response.get_header("missing")
110
- end
111
-
112
- end
113
-
114
- end
115
-
116
- end
117
-
118
- env_restore
119
- end