excon 0.62.0 → 0.92.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. checksums.yaml +5 -5
  2. data/CONTRIBUTING.md +0 -1
  3. data/LICENSE.md +1 -1
  4. data/README.md +7 -6
  5. data/data/cacert.pem +1220 -1828
  6. data/excon.gemspec +19 -3
  7. data/lib/excon/connection.rb +216 -139
  8. data/lib/excon/constants.rb +38 -13
  9. data/lib/excon/error.rb +15 -0
  10. data/lib/excon/headers.rb +4 -3
  11. data/lib/excon/instrumentors/logging_instrumentor.rb +5 -16
  12. data/lib/excon/instrumentors/standard_instrumentor.rb +2 -9
  13. data/lib/excon/middlewares/base.rb +6 -0
  14. data/lib/excon/middlewares/capture_cookies.rb +1 -1
  15. data/lib/excon/middlewares/decompress.rb +11 -4
  16. data/lib/excon/middlewares/expects.rb +7 -1
  17. data/lib/excon/middlewares/idempotent.rb +20 -3
  18. data/lib/excon/middlewares/instrumentor.rb +8 -0
  19. data/lib/excon/middlewares/mock.rb +12 -3
  20. data/lib/excon/middlewares/redirect_follower.rb +25 -3
  21. data/lib/excon/middlewares/response_parser.rb +3 -0
  22. data/lib/excon/pretty_printer.rb +1 -8
  23. data/lib/excon/response.rb +12 -9
  24. data/lib/excon/socket.rb +59 -42
  25. data/lib/excon/ssl_socket.rb +37 -15
  26. data/lib/excon/test/plugin/server/exec.rb +5 -2
  27. data/lib/excon/test/plugin/server/puma.rb +4 -1
  28. data/lib/excon/test/plugin/server/unicorn.rb +5 -0
  29. data/lib/excon/test/plugin/server/webrick.rb +4 -1
  30. data/lib/excon/test/server.rb +1 -1
  31. data/lib/excon/unix_socket.rb +1 -0
  32. data/lib/excon/utils.rb +59 -5
  33. data/lib/excon/version.rb +1 -1
  34. data/lib/excon.rb +25 -17
  35. metadata +27 -98
  36. data/.document +0 -5
  37. data/.gitignore +0 -13
  38. data/.rspec +0 -3
  39. data/.travis.yml +0 -29
  40. data/Gemfile +0 -19
  41. data/Rakefile +0 -41
  42. data/benchmarks/class_vs_lambda.rb +0 -50
  43. data/benchmarks/concat_vs_insert.rb +0 -21
  44. data/benchmarks/concat_vs_interpolate.rb +0 -22
  45. data/benchmarks/cr_lf.rb +0 -21
  46. data/benchmarks/downcase-eq-eq_vs_casecmp.rb +0 -169
  47. data/benchmarks/excon.rb +0 -69
  48. data/benchmarks/excon_vs.rb +0 -165
  49. data/benchmarks/for_vs_array_each.rb +0 -27
  50. data/benchmarks/for_vs_hash_each.rb +0 -27
  51. data/benchmarks/has_key-vs-lookup.rb +0 -177
  52. data/benchmarks/headers_case_sensitivity.rb +0 -83
  53. data/benchmarks/headers_split_vs_match.rb +0 -34
  54. data/benchmarks/implicit_block-vs-explicit_block.rb +0 -98
  55. data/benchmarks/merging.rb +0 -21
  56. data/benchmarks/single_vs_double_quotes.rb +0 -21
  57. data/benchmarks/string_ranged_index.rb +0 -87
  58. data/benchmarks/strip_newline.rb +0 -115
  59. data/benchmarks/vs_stdlib.rb +0 -82
  60. data/changelog.txt +0 -1083
  61. data/spec/excon/error_spec.rb +0 -139
  62. data/spec/excon/test/server_spec.rb +0 -28
  63. data/spec/excon_spec.rb +0 -7
  64. data/spec/helpers/file_path_helpers.rb +0 -22
  65. data/spec/requests/basic_spec.rb +0 -40
  66. data/spec/requests/eof_requests_spec.rb +0 -36
  67. data/spec/requests/unix_socket_spec.rb +0 -46
  68. data/spec/spec_helper.rb +0 -24
  69. data/spec/support/shared_contexts/test_server_context.rb +0 -83
  70. data/spec/support/shared_examples/shared_example_for_clients.rb +0 -218
  71. data/spec/support/shared_examples/shared_example_for_streaming_clients.rb +0 -20
  72. data/spec/support/shared_examples/shared_example_for_test_servers.rb +0 -16
  73. data/tests/authorization_header_tests.rb +0 -29
  74. data/tests/bad_tests.rb +0 -47
  75. data/tests/basic_tests.rb +0 -351
  76. data/tests/batch_requests.rb +0 -133
  77. data/tests/complete_responses.rb +0 -31
  78. data/tests/data/127.0.0.1.cert.crt +0 -20
  79. data/tests/data/127.0.0.1.cert.key +0 -27
  80. data/tests/data/excon.cert.crt +0 -20
  81. data/tests/data/excon.cert.key +0 -27
  82. data/tests/data/xs +0 -1
  83. data/tests/error_tests.rb +0 -145
  84. data/tests/header_tests.rb +0 -119
  85. data/tests/middlewares/canned_response_tests.rb +0 -34
  86. data/tests/middlewares/capture_cookies_tests.rb +0 -34
  87. data/tests/middlewares/decompress_tests.rb +0 -157
  88. data/tests/middlewares/escape_path_tests.rb +0 -36
  89. data/tests/middlewares/idempotent_tests.rb +0 -206
  90. data/tests/middlewares/instrumentation_tests.rb +0 -315
  91. data/tests/middlewares/mock_tests.rb +0 -304
  92. data/tests/middlewares/redirect_follower_tests.rb +0 -112
  93. data/tests/pipeline_tests.rb +0 -40
  94. data/tests/proxy_tests.rb +0 -306
  95. data/tests/query_string_tests.rb +0 -87
  96. data/tests/rackups/basic.rb +0 -41
  97. data/tests/rackups/basic.ru +0 -3
  98. data/tests/rackups/basic_auth.ru +0 -14
  99. data/tests/rackups/deflater.ru +0 -4
  100. data/tests/rackups/proxy.ru +0 -18
  101. data/tests/rackups/query_string.ru +0 -13
  102. data/tests/rackups/redirecting.ru +0 -23
  103. data/tests/rackups/redirecting_with_cookie.ru +0 -40
  104. data/tests/rackups/request_headers.ru +0 -15
  105. data/tests/rackups/request_methods.ru +0 -21
  106. data/tests/rackups/response_header.ru +0 -18
  107. data/tests/rackups/ssl.ru +0 -16
  108. data/tests/rackups/ssl_mismatched_cn.ru +0 -15
  109. data/tests/rackups/ssl_verify_peer.ru +0 -16
  110. data/tests/rackups/streaming.ru +0 -30
  111. data/tests/rackups/thread_safety.ru +0 -17
  112. data/tests/rackups/timeout.ru +0 -14
  113. data/tests/rackups/webrick_patch.rb +0 -34
  114. data/tests/request_headers_tests.rb +0 -21
  115. data/tests/request_method_tests.rb +0 -47
  116. data/tests/request_tests.rb +0 -59
  117. data/tests/response_tests.rb +0 -197
  118. data/tests/servers/bad.rb +0 -20
  119. data/tests/servers/eof.rb +0 -17
  120. data/tests/servers/error.rb +0 -20
  121. data/tests/servers/good.rb +0 -350
  122. data/tests/test_helper.rb +0 -306
  123. data/tests/thread_safety_tests.rb +0 -39
  124. data/tests/timeout_tests.rb +0 -12
  125. data/tests/utils_tests.rb +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ece261b6f71e5d1d196cca01f591d973631ee0f3
4
- data.tar.gz: 6c4ec564c3ceb6cf87205d2d8430d01a194995bc
2
+ SHA256:
3
+ metadata.gz: 6e1d2543cfa4fed3d32e2715d1720e9c2cfbf7896aab7840bca1cad7244ff64e
4
+ data.tar.gz: 28d34d55b2c1f35aaf82e60364f1524d8d787ff354beaa2ca1ba20c1619c2a1d
5
5
  SHA512:
6
- metadata.gz: d6e40cc178da6850ce417ba0fce0630a99bb361199c07653a6f6dcefe829373a86af1083d4218b472c94419a1bac2a509083bf577640f1ce59e899759649c726
7
- data.tar.gz: 131bd06ee001c1246a6b3d720db1e545275146ba886a310d675724a86bd5fef6270c77c196d920c4002cf8661899a9591a00808b3e206ffea1cf4dca45578496
6
+ metadata.gz: 720b76b1ce0b7bc046f6496bcf2e6c0427bbfd8b91026ab694ed321d2e76fc6f34d0f16ee2a63578b03e524535fb783ed6b2e63e15487b3995eb919d6e6e3afe
7
+ data.tar.gz: e8841ed36289b733b4b879cb3b122fcd39617843e384eda88d06eb215ba86e39bcb8e1080b19c84ac8d981c7b4421701b07b0c9a64e2333760c1328d9e3734b0
data/CONTRIBUTING.md CHANGED
@@ -19,5 +19,4 @@ New contributors are always welcome, when it doubt please ask questions. We stri
19
19
  * Write and help edit [documentation](https://github.com/excon/excon.github.com).
20
20
  * Translate [documentation](https://github.com/excon/excon.github.com) in to other languages.
21
21
  * Organize or volunteer at events.
22
- * [Donate](https://www.gittip.com/geemus/)!
23
22
  * Discuss other ideas for contribution with [geemus](mailto:geemus+excon@gmail.com).
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2009-2015 [CONTRIBUTORS.md](https://github.com/excon/excon/blob/master/CONTRIBUTORS.md)
3
+ Copyright (c) 2009-2019 [CONTRIBUTORS.md](https://github.com/excon/excon/blob/master/CONTRIBUTORS.md)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -4,10 +4,8 @@ Usable, fast, simple Ruby HTTP 1.1
4
4
 
5
5
  Excon was designed to be simple, fast and performant. It works great as a general HTTP(s) client and is particularly well suited to usage in API clients.
6
6
 
7
- [![Build Status](https://travis-ci.org/excon/excon.svg?branch=master)](https://travis-ci.org/excon/excon)
8
- [![Dependency Status](https://gemnasium.com/excon/excon.svg)](https://gemnasium.com/excon/excon)
7
+ [![Build Status](https://github.com/excon/excon/actions/workflows/ruby.yml/badge.svg)](https://github.com/excon/excon/actions/workflows/ruby.yml)
9
8
  [![Gem Version](https://badge.fury.io/rb/excon.svg)](https://badge.fury.io/rb/excon)
10
- [![Gittip](https://img.shields.io/gittip/geemus.svg)](https://www.gittip.com/geemus/)
11
9
 
12
10
  * [Getting Started](#getting-started)
13
11
  * [Options](#options)
@@ -103,7 +101,7 @@ Here are a few common examples:
103
101
 
104
102
  ```ruby
105
103
  # Output debug info, similar to ENV['EXCON_DEBUG']
106
- connection = Excon.new('http://geemus.com/', :debug_request => true, :debug_response => true)
104
+ connection = Excon.new('http://geemus.com/', :debug => true)
107
105
 
108
106
  # Custom headers
109
107
  Excon.get('http://geemus.com', :headers => {'Authorization' => 'Basic 0123456789ABCDEF'})
@@ -130,7 +128,7 @@ connection.request(:method => 'GET')
130
128
  # expect one or more status codes, or raise an error
131
129
  connection.request(:expects => [200, 201], :method => :get)
132
130
 
133
- # this request can be repeated safely, so retry on errors up to 3 times
131
+ # this request can be repeated safely, so retry on errors up to 4 times
134
132
  connection.request(:idempotent => true)
135
133
 
136
134
  # this request can be repeated safely, retry up to 6 times
@@ -161,6 +159,9 @@ connection = Excon.new('http://geemus.com/', :nonblock => false)
161
159
 
162
160
  # use basic authentication by supplying credentials in the URL or as parameters
163
161
  connection = Excon.new('http://username:password@secure.geemus.com')
162
+ # Note: username & password is unescaped for request, so you should provide escaped values here
163
+ # i. e. instead of `password: 'pa%%word'` you should use `password: Excon::Utils.escape_uri('pa%%word')`,
164
+ # which return `pa%25%25word`
164
165
  connection = Excon.new('http://secure.geemus.com',
165
166
  :user => 'username', :password => 'password')
166
167
 
@@ -252,7 +253,7 @@ The proxy URL must be fully specified, including scheme (e.g. "http://") and por
252
253
 
253
254
  Proxy support must be set when establishing a connection object and cannot be overridden in individual requests.
254
255
 
255
- NOTE: Excon will use the environment variables `http_proxy` and `https_proxy` if they are present. If these variables are set they will take precedence over a :proxy option specified in code. If "https_proxy" is not set, the value of "http_proxy" will be used for both HTTP and HTTPS connections.
256
+ NOTE: Excon will use `HTTP_PROXY` and `HTTPS_PROXY` environment variables. If set they will take precedence over any :proxy option specified in code. If "HTTPS_PROXY" is not set, "HTTP_PROXY" will be used for both HTTP and HTTPS connections. To disable this behavior, set the `NO_PROXY` environment variable and other environment variable proxy settings will be disregarded.
256
257
 
257
258
  ## Reusable ports
258
259