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.
- checksums.yaml +5 -5
- data/CONTRIBUTING.md +0 -1
- data/LICENSE.md +1 -1
- data/README.md +7 -6
- data/data/cacert.pem +1220 -1828
- data/excon.gemspec +19 -3
- data/lib/excon/connection.rb +216 -139
- data/lib/excon/constants.rb +38 -13
- data/lib/excon/error.rb +15 -0
- data/lib/excon/headers.rb +4 -3
- data/lib/excon/instrumentors/logging_instrumentor.rb +5 -16
- data/lib/excon/instrumentors/standard_instrumentor.rb +2 -9
- data/lib/excon/middlewares/base.rb +6 -0
- data/lib/excon/middlewares/capture_cookies.rb +1 -1
- data/lib/excon/middlewares/decompress.rb +11 -4
- data/lib/excon/middlewares/expects.rb +7 -1
- data/lib/excon/middlewares/idempotent.rb +20 -3
- data/lib/excon/middlewares/instrumentor.rb +8 -0
- data/lib/excon/middlewares/mock.rb +12 -3
- data/lib/excon/middlewares/redirect_follower.rb +25 -3
- data/lib/excon/middlewares/response_parser.rb +3 -0
- data/lib/excon/pretty_printer.rb +1 -8
- data/lib/excon/response.rb +12 -9
- data/lib/excon/socket.rb +59 -42
- data/lib/excon/ssl_socket.rb +37 -15
- data/lib/excon/test/plugin/server/exec.rb +5 -2
- data/lib/excon/test/plugin/server/puma.rb +4 -1
- data/lib/excon/test/plugin/server/unicorn.rb +5 -0
- data/lib/excon/test/plugin/server/webrick.rb +4 -1
- data/lib/excon/test/server.rb +1 -1
- data/lib/excon/unix_socket.rb +1 -0
- data/lib/excon/utils.rb +59 -5
- data/lib/excon/version.rb +1 -1
- data/lib/excon.rb +25 -17
- metadata +27 -98
- data/.document +0 -5
- data/.gitignore +0 -13
- data/.rspec +0 -3
- data/.travis.yml +0 -29
- data/Gemfile +0 -19
- data/Rakefile +0 -41
- data/benchmarks/class_vs_lambda.rb +0 -50
- data/benchmarks/concat_vs_insert.rb +0 -21
- data/benchmarks/concat_vs_interpolate.rb +0 -22
- data/benchmarks/cr_lf.rb +0 -21
- data/benchmarks/downcase-eq-eq_vs_casecmp.rb +0 -169
- data/benchmarks/excon.rb +0 -69
- data/benchmarks/excon_vs.rb +0 -165
- data/benchmarks/for_vs_array_each.rb +0 -27
- data/benchmarks/for_vs_hash_each.rb +0 -27
- data/benchmarks/has_key-vs-lookup.rb +0 -177
- data/benchmarks/headers_case_sensitivity.rb +0 -83
- data/benchmarks/headers_split_vs_match.rb +0 -34
- data/benchmarks/implicit_block-vs-explicit_block.rb +0 -98
- data/benchmarks/merging.rb +0 -21
- data/benchmarks/single_vs_double_quotes.rb +0 -21
- data/benchmarks/string_ranged_index.rb +0 -87
- data/benchmarks/strip_newline.rb +0 -115
- data/benchmarks/vs_stdlib.rb +0 -82
- data/changelog.txt +0 -1083
- data/spec/excon/error_spec.rb +0 -139
- data/spec/excon/test/server_spec.rb +0 -28
- data/spec/excon_spec.rb +0 -7
- data/spec/helpers/file_path_helpers.rb +0 -22
- data/spec/requests/basic_spec.rb +0 -40
- data/spec/requests/eof_requests_spec.rb +0 -36
- data/spec/requests/unix_socket_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -24
- data/spec/support/shared_contexts/test_server_context.rb +0 -83
- data/spec/support/shared_examples/shared_example_for_clients.rb +0 -218
- data/spec/support/shared_examples/shared_example_for_streaming_clients.rb +0 -20
- data/spec/support/shared_examples/shared_example_for_test_servers.rb +0 -16
- data/tests/authorization_header_tests.rb +0 -29
- data/tests/bad_tests.rb +0 -47
- data/tests/basic_tests.rb +0 -351
- data/tests/batch_requests.rb +0 -133
- data/tests/complete_responses.rb +0 -31
- data/tests/data/127.0.0.1.cert.crt +0 -20
- data/tests/data/127.0.0.1.cert.key +0 -27
- data/tests/data/excon.cert.crt +0 -20
- data/tests/data/excon.cert.key +0 -27
- data/tests/data/xs +0 -1
- data/tests/error_tests.rb +0 -145
- data/tests/header_tests.rb +0 -119
- data/tests/middlewares/canned_response_tests.rb +0 -34
- data/tests/middlewares/capture_cookies_tests.rb +0 -34
- data/tests/middlewares/decompress_tests.rb +0 -157
- data/tests/middlewares/escape_path_tests.rb +0 -36
- data/tests/middlewares/idempotent_tests.rb +0 -206
- data/tests/middlewares/instrumentation_tests.rb +0 -315
- data/tests/middlewares/mock_tests.rb +0 -304
- data/tests/middlewares/redirect_follower_tests.rb +0 -112
- data/tests/pipeline_tests.rb +0 -40
- data/tests/proxy_tests.rb +0 -306
- data/tests/query_string_tests.rb +0 -87
- data/tests/rackups/basic.rb +0 -41
- data/tests/rackups/basic.ru +0 -3
- data/tests/rackups/basic_auth.ru +0 -14
- data/tests/rackups/deflater.ru +0 -4
- data/tests/rackups/proxy.ru +0 -18
- data/tests/rackups/query_string.ru +0 -13
- data/tests/rackups/redirecting.ru +0 -23
- data/tests/rackups/redirecting_with_cookie.ru +0 -40
- data/tests/rackups/request_headers.ru +0 -15
- data/tests/rackups/request_methods.ru +0 -21
- data/tests/rackups/response_header.ru +0 -18
- data/tests/rackups/ssl.ru +0 -16
- data/tests/rackups/ssl_mismatched_cn.ru +0 -15
- data/tests/rackups/ssl_verify_peer.ru +0 -16
- data/tests/rackups/streaming.ru +0 -30
- data/tests/rackups/thread_safety.ru +0 -17
- data/tests/rackups/timeout.ru +0 -14
- data/tests/rackups/webrick_patch.rb +0 -34
- data/tests/request_headers_tests.rb +0 -21
- data/tests/request_method_tests.rb +0 -47
- data/tests/request_tests.rb +0 -59
- data/tests/response_tests.rb +0 -197
- data/tests/servers/bad.rb +0 -20
- data/tests/servers/eof.rb +0 -17
- data/tests/servers/error.rb +0 -20
- data/tests/servers/good.rb +0 -350
- data/tests/test_helper.rb +0 -306
- data/tests/thread_safety_tests.rb +0 -39
- data/tests/timeout_tests.rb +0 -12
- data/tests/utils_tests.rb +0 -81
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6e1d2543cfa4fed3d32e2715d1720e9c2cfbf7896aab7840bca1cad7244ff64e
|
|
4
|
+
data.tar.gz: 28d34d55b2c1f35aaf82e60364f1524d8d787ff354beaa2ca1ba20c1619c2a1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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-
|
|
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
|
-
[](https://gemnasium.com/excon/excon)
|
|
7
|
+
[](https://github.com/excon/excon/actions/workflows/ruby.yml)
|
|
9
8
|
[](https://badge.fury.io/rb/excon)
|
|
10
|
-
[](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/', :
|
|
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
|
|
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
|
|
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
|
|