pingram 1.0.40 → 1.0.41
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 +4 -4
- data/Gemfile.lock +5 -5
- data/lib/pingram/api/account_api.rb +191 -4
- data/lib/pingram/api/webhooks_api.rb +6 -6
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/account_get_response_billing_alerts.rb +1 -1
- data/lib/pingram/models/account_payment_methods.rb +214 -0
- data/lib/pingram/models/account_payment_methods_payment_methods_inner.rb +270 -0
- data/lib/pingram/models/assign_payment_method_request.rb +216 -0
- data/lib/pingram/models/billing_post_response_body.rb +1 -1
- data/lib/pingram/models/confirm_change_email_request.rb +14 -4
- data/lib/pingram/models/confirm_change_email_response.rb +192 -0
- data/lib/pingram/models/confirm_password_change_request.rb +191 -0
- data/lib/pingram/models/create_payment_method_setup_request.rb +191 -0
- data/lib/pingram/models/list_invoices_response_invoices_inner.rb +1 -1
- data/lib/pingram/models/logs_get_response_logs_inner.rb +10 -1
- data/lib/pingram/models/password_status_response.rb +195 -0
- data/lib/pingram/models/payment_method_setup.rb +191 -0
- data/lib/pingram/models/sign_in_username_request.rb +164 -0
- data/lib/pingram/models/sign_in_username_response.rb +165 -0
- data/lib/pingram/models/start_change_email_request.rb +13 -20
- data/lib/pingram/models/start_password_change_request.rb +185 -0
- data/lib/pingram/models/webhook_endpoint.rb +14 -5
- data/lib/pingram/models/webhook_endpoint_basic_auth.rb +193 -0
- data/lib/pingram/models/webhook_endpoint_upsert_request.rb +15 -5
- data/lib/pingram/models/webhook_endpoint_upsert_request_basic_auth.rb +176 -0
- data/lib/pingram/models/webhook_endpoints_response_endpoints_inner.rb +14 -5
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/cache/ethon-0.19.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/typhoeus-1.7.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/gem_make.out +10 -10
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.5/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/CHANGELOG.md +1120 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/README.md +261 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curl.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/classes.rb +337 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/codes.rb +28 -9
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/constants.rb +61 -4
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/form_options.rb +2 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/functions.rb +107 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/infos.rb +104 -5
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/introspection.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/introspection_constants.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/mime.rb +187 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/optional.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/options.rb +298 -71
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/settings.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/share.rb +165 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/share_constants.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/url.rb +171 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/curls/url_constants.rb +78 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/callbacks.rb +281 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/features.rb +4 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/files.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/form.rb +65 -6
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/header.rb +103 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/headers_api.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/actionable.rb +25 -3
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/get.rb +5 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/post.rb +1 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/postable.rb +9 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/http/putable.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http.rb +16 -4
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/informations.rb +51 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/mime.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/mirror.rb +49 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/operations.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/options.rb +369 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/queryable.rb +59 -14
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/response_callbacks.rb +33 -12
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/share.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/url.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/easy/util.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy.rb +185 -10
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/fork_safety.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/form_add.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/global_init.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/header.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/invalid_option.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/invalid_value.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/mime.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_add.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_assign.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_fdset.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_perform.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_poll.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_remove.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/multi_timeout.rb +2 -2
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_wait.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/multi_wakeup.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/select.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/set_option.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/share.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/unsupported_option.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/errors/url.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/libc.rb +50 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/loggable.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/operations.rb +472 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.19.1/lib/ethon/multi/stack.rb +220 -0
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/multi.rb +51 -15
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/version.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon.rb +8 -9
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/console.c +8 -3
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/extconf.rb +7 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.5/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/CHANGELOG.md +228 -1
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/README.md +766 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/UPGRADE.md +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/rack/typhoeus/middleware/params_decoder/helper.rb +129 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/rack/typhoeus/middleware/params_decoder.rb +8 -19
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/rack/typhoeus.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/adapters/faraday.rb +89 -28
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/dalli.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/rails.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/cache/redis.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/config.rb +51 -7
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/easy_factory.rb +129 -23
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/errors/invalid_option.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/errors/no_response.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors/no_stub.rb +8 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors/typhoeus_error.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/errors.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/expectation.rb +33 -1
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/hydra/queueable.rb +29 -4
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/hydra.rb +423 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/pool.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/railtie.rb +4 -2
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/actions.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/callbacks.rb +11 -4
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/marshal.rb +5 -2
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/request/streamable.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/request.rb +510 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/cacheable.rb +2 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus/response/header.rb +325 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/informations.rb +75 -12
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/status.rb +4 -13
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/version.rb +3 -1
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.7.1/lib/typhoeus.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/typhoeus.gemspec +15 -3
- data/vendor/bundle/ruby/3.2.0/specifications/{ethon-0.18.0.gemspec → ethon-0.19.1.gemspec} +4 -4
- data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.4.gemspec → io-console-0.9.5.gemspec} +3 -3
- data/vendor/bundle/ruby/3.2.0/specifications/{typhoeus-1.6.0.gemspec → typhoeus-1.7.1.gemspec} +5 -5
- metadata +156 -129
- data/vendor/bundle/ruby/3.2.0/cache/ethon-0.18.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/typhoeus-1.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/CHANGELOG.md +0 -417
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/README.md +0 -118
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/classes.rb +0 -65
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/functions.rb +0 -58
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/curls/settings.rb +0 -12
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/callbacks.rb +0 -155
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/header.rb +0 -61
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/http/putable.rb +0 -25
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/mirror.rb +0 -36
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/operations.rb +0 -64
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/options.rb +0 -50
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/easy/util.rb +0 -28
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/errors/invalid_value.rb +0 -13
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/libc.rb +0 -21
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/operations.rb +0 -228
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/options.rb +0 -117
- data/vendor/bundle/ruby/3.2.0/gems/ethon-0.18.0/lib/ethon/multi/stack.rb +0 -49
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.4/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/README.md +0 -588
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/rack/typhoeus/middleware/params_decoder/helper.rb +0 -76
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/addable.rb +0 -23
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/before.rb +0 -31
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/block_connection.rb +0 -35
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/cacheable.rb +0 -15
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/memoizable.rb +0 -56
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/runnable.rb +0 -19
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra/stubbable.rb +0 -28
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/hydra.rb +0 -95
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/pool.rb +0 -70
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/before.rb +0 -30
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/block_connection.rb +0 -52
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/cacheable.rb +0 -38
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/memoizable.rb +0 -38
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/operations.rb +0 -40
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/responseable.rb +0 -29
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request/stubbable.rb +0 -30
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/request.rb +0 -223
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus/response/header.rb +0 -105
- data/vendor/bundle/ruby/3.2.0/gems/typhoeus-1.6.0/lib/typhoeus.rb +0 -143
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.4 → io-console-0.9.5}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/ethon.gemspec +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/curls/messages.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/debug_info.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/custom.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/delete.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/head.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/options.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/patch.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/http/put.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/easy/params.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{ethon-0.18.0 → ethon-0.19.1}/lib/ethon/errors/ethon_error.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/.document +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/README.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/Makefile +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/ext/io/console/win32_vk.inc +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.4 → io-console-0.9.5}/lib/io/console/size.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/LICENSE +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'delegate'
|
|
4
|
+
|
|
5
|
+
module Typhoeus
|
|
6
|
+
class Response
|
|
7
|
+
|
|
8
|
+
# This class represents the response header.
|
|
9
|
+
# It can be accessed like a hash.
|
|
10
|
+
# Values can be strings (normal case) or arrays of strings (for duplicates headers)
|
|
11
|
+
#
|
|
12
|
+
# @api private
|
|
13
|
+
class Header < DelegateClass(Hash)
|
|
14
|
+
|
|
15
|
+
# Create a new header.
|
|
16
|
+
#
|
|
17
|
+
# @example Create new header.
|
|
18
|
+
# Header.new(raw)
|
|
19
|
+
#
|
|
20
|
+
# @param [ String ] raw The raw header.
|
|
21
|
+
def initialize(raw)
|
|
22
|
+
super({})
|
|
23
|
+
@raw = raw
|
|
24
|
+
@sanitized = {}
|
|
25
|
+
parse
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def initialize_dup(other)
|
|
29
|
+
super
|
|
30
|
+
copy_delegate(other)
|
|
31
|
+
end
|
|
32
|
+
private :initialize_dup
|
|
33
|
+
|
|
34
|
+
def initialize_clone(other, freeze: nil)
|
|
35
|
+
if freeze.nil?
|
|
36
|
+
super(other)
|
|
37
|
+
else
|
|
38
|
+
super(other, freeze: freeze)
|
|
39
|
+
end
|
|
40
|
+
copy_delegate(other)
|
|
41
|
+
end
|
|
42
|
+
private :initialize_clone
|
|
43
|
+
|
|
44
|
+
def [](key)
|
|
45
|
+
@sanitized[convert_key(key)]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def []=(key, value)
|
|
49
|
+
# Store string keys so the delegated Hash and the case-insensitive
|
|
50
|
+
# index describe the same header set even when a caller used a symbol.
|
|
51
|
+
key = key.to_s
|
|
52
|
+
delete_underlying_key(key)
|
|
53
|
+
__getobj__[key] = value
|
|
54
|
+
@sanitized[convert_key(key)] = value
|
|
55
|
+
end
|
|
56
|
+
alias_method :store, :[]=
|
|
57
|
+
|
|
58
|
+
def merge(other)
|
|
59
|
+
merged = dup
|
|
60
|
+
merged.update(other) do |key, old, new|
|
|
61
|
+
block_given? ? yield(key, old, new) : new
|
|
62
|
+
end
|
|
63
|
+
merged
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def delete(key)
|
|
67
|
+
value = self[key]
|
|
68
|
+
delete_underlying_key(key)
|
|
69
|
+
@sanitized.delete(convert_key(key))
|
|
70
|
+
value
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def clear
|
|
74
|
+
__getobj__.clear
|
|
75
|
+
@sanitized.clear
|
|
76
|
+
self
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def update(other)
|
|
80
|
+
other.each_pair do |key, value|
|
|
81
|
+
value = yield(key, self[key], value) if block_given? && include?(key)
|
|
82
|
+
self[key] = value
|
|
83
|
+
end
|
|
84
|
+
self
|
|
85
|
+
end
|
|
86
|
+
alias_method :merge!, :update
|
|
87
|
+
|
|
88
|
+
def replace(other)
|
|
89
|
+
clear
|
|
90
|
+
update(other)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def delete_if(&block)
|
|
94
|
+
return enum_for(:delete_if) unless block
|
|
95
|
+
|
|
96
|
+
super
|
|
97
|
+
rebuild_sanitized
|
|
98
|
+
self
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def keep_if(&block)
|
|
102
|
+
return enum_for(:keep_if) unless block
|
|
103
|
+
|
|
104
|
+
super
|
|
105
|
+
rebuild_sanitized
|
|
106
|
+
self
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def select!(&block)
|
|
110
|
+
return enum_for(:select!) unless block
|
|
111
|
+
|
|
112
|
+
result = super
|
|
113
|
+
rebuild_sanitized
|
|
114
|
+
result ? self : nil
|
|
115
|
+
end
|
|
116
|
+
alias_method :filter!, :select!
|
|
117
|
+
|
|
118
|
+
def reject!(&block)
|
|
119
|
+
return enum_for(:reject!) unless block
|
|
120
|
+
|
|
121
|
+
result = super
|
|
122
|
+
rebuild_sanitized
|
|
123
|
+
result ? self : nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def shift
|
|
127
|
+
result = super
|
|
128
|
+
rebuild_sanitized
|
|
129
|
+
result
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def compact!
|
|
133
|
+
result = super
|
|
134
|
+
rebuild_sanitized
|
|
135
|
+
result ? self : nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def transform_keys!(*args, &block)
|
|
139
|
+
return enum_for(:transform_keys!, *args) if !block && args.empty?
|
|
140
|
+
|
|
141
|
+
super
|
|
142
|
+
rebuild_sanitized
|
|
143
|
+
self
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def transform_values!(&block)
|
|
147
|
+
return enum_for(:transform_values!) unless block
|
|
148
|
+
|
|
149
|
+
super
|
|
150
|
+
rebuild_sanitized
|
|
151
|
+
self
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def include?(key)
|
|
155
|
+
@sanitized.include?(convert_key(key))
|
|
156
|
+
end
|
|
157
|
+
alias_method :has_key?, :include?
|
|
158
|
+
alias_method :key?, :include?
|
|
159
|
+
alias_method :member?, :include?
|
|
160
|
+
|
|
161
|
+
def fetch(key, *extras, &block)
|
|
162
|
+
if block
|
|
163
|
+
# Hash#fetch yields the key the caller asked for, not a normalized
|
|
164
|
+
# one. Keep that behavior while looking up case-insensitively.
|
|
165
|
+
@sanitized.fetch(convert_key(key), *extras) { block.call(key) }
|
|
166
|
+
else
|
|
167
|
+
@sanitized.fetch(convert_key(key), *extras)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def dig(key, *identifiers)
|
|
172
|
+
@sanitized.dig(convert_key(key), *identifiers)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def assoc(key)
|
|
176
|
+
@sanitized.assoc(convert_key(key))
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def values_at(*keys)
|
|
180
|
+
keys.map! { |key| convert_key(key) }
|
|
181
|
+
@sanitized.values_at(*keys)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def fetch_values(*indices, &block)
|
|
185
|
+
indices.map do |key|
|
|
186
|
+
converted = convert_key(key)
|
|
187
|
+
if @sanitized.key?(converted)
|
|
188
|
+
@sanitized[converted]
|
|
189
|
+
elsif block
|
|
190
|
+
block.call(key)
|
|
191
|
+
else
|
|
192
|
+
@sanitized.fetch(converted)
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Parses the raw header.
|
|
198
|
+
#
|
|
199
|
+
# @example Parse header.
|
|
200
|
+
# header.parse
|
|
201
|
+
def parse
|
|
202
|
+
if raw.respond_to?(:each_pair)
|
|
203
|
+
raw.each_pair do |k, v|
|
|
204
|
+
process_pair(k, v)
|
|
205
|
+
end
|
|
206
|
+
elsif raw.is_a?(String)
|
|
207
|
+
raw.split(/\r?\n(?!\s)/).each do |header|
|
|
208
|
+
header.strip!
|
|
209
|
+
next if header.empty? || header.start_with?( 'HTTP/' )
|
|
210
|
+
process_line(header)
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
private
|
|
216
|
+
|
|
217
|
+
# Processes line and saves the result.
|
|
218
|
+
#
|
|
219
|
+
# @return [ void ]
|
|
220
|
+
def process_line(header)
|
|
221
|
+
key, value = header.split(':', 2)
|
|
222
|
+
process_pair(key.strip, (value ? value.strip.gsub(/\r?\n\s*/, ' ') : ''))
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Sets key value pair for self and @sanitized.
|
|
226
|
+
#
|
|
227
|
+
# @return [ void ]
|
|
228
|
+
def process_pair(key, value)
|
|
229
|
+
sanitized_key = convert_key(key)
|
|
230
|
+
set_value(sanitized_key, duplicate_value(value), @sanitized)
|
|
231
|
+
self[key] = @sanitized[sanitized_key]
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Sets value for key in specified hash
|
|
235
|
+
#
|
|
236
|
+
# @return [ void ]
|
|
237
|
+
def set_value(key, value, hash)
|
|
238
|
+
current_value = hash[key]
|
|
239
|
+
if current_value
|
|
240
|
+
if current_value.is_a? Array
|
|
241
|
+
current_value << value
|
|
242
|
+
else
|
|
243
|
+
hash[key] = [current_value, value]
|
|
244
|
+
end
|
|
245
|
+
else
|
|
246
|
+
hash[key] = value
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the raw header or empty string.
|
|
251
|
+
#
|
|
252
|
+
# @example Return raw header.
|
|
253
|
+
# header.raw
|
|
254
|
+
#
|
|
255
|
+
# @return [ String ] The raw header.
|
|
256
|
+
def raw
|
|
257
|
+
@raw || ''
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def convert_key(key)
|
|
261
|
+
key.to_s.downcase
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def duplicate_value(value)
|
|
265
|
+
case value
|
|
266
|
+
when Array
|
|
267
|
+
value.map { |nested| duplicate_value(nested) }
|
|
268
|
+
when String
|
|
269
|
+
value.dup
|
|
270
|
+
else
|
|
271
|
+
value
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# DelegateClass copies only the delegated hash itself. Rebuild both
|
|
276
|
+
# hashes so later mutations cannot reach the original header. The
|
|
277
|
+
# sanitized index is built from the copied hash so both stores keep
|
|
278
|
+
# referring to the same values, as they do on the original.
|
|
279
|
+
def copy_delegate(other)
|
|
280
|
+
copy = {}
|
|
281
|
+
other.__getobj__.each do |key, value|
|
|
282
|
+
copy[key] = duplicate_value(value)
|
|
283
|
+
end
|
|
284
|
+
__setobj__(copy)
|
|
285
|
+
|
|
286
|
+
@sanitized = {}
|
|
287
|
+
copy.each do |key, value|
|
|
288
|
+
converted = convert_key(key)
|
|
289
|
+
if @sanitized.key?(converted)
|
|
290
|
+
existing = @sanitized[converted]
|
|
291
|
+
existing = [existing] unless existing.is_a?(Array)
|
|
292
|
+
existing.concat(value.is_a?(Array) ? value : [value])
|
|
293
|
+
@sanitized[converted] = existing
|
|
294
|
+
else
|
|
295
|
+
@sanitized[converted] = value
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def delete_underlying_key(key)
|
|
301
|
+
converted = convert_key(key)
|
|
302
|
+
__getobj__.keys.each do |existing_key|
|
|
303
|
+
__getobj__.delete(existing_key) if convert_key(existing_key) == converted
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
# Rebuild the case-insensitive index after a Hash mutator that cannot be
|
|
308
|
+
# expressed through #[]=.
|
|
309
|
+
def rebuild_sanitized
|
|
310
|
+
@sanitized = {}
|
|
311
|
+
__getobj__.each do |key, value|
|
|
312
|
+
converted = convert_key(key)
|
|
313
|
+
if @sanitized.key?(converted)
|
|
314
|
+
existing = @sanitized[converted]
|
|
315
|
+
existing = [existing] unless existing.is_a?(Array)
|
|
316
|
+
existing.concat(value.is_a?(Array) ? value : [value])
|
|
317
|
+
@sanitized[converted] = existing
|
|
318
|
+
else
|
|
319
|
+
@sanitized[converted] = value
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Typhoeus
|
|
2
4
|
class Response
|
|
3
5
|
|
|
@@ -27,6 +29,17 @@ module Typhoeus
|
|
|
27
29
|
Ethon::Curl.easy_strerror(return_code) if return_code
|
|
28
30
|
end
|
|
29
31
|
|
|
32
|
+
# Returns the detailed error message from libcurl's error buffer,
|
|
33
|
+
# only available when the request was made with errorbuffer: true.
|
|
34
|
+
#
|
|
35
|
+
# @example Get error_message.
|
|
36
|
+
# response.error_message
|
|
37
|
+
#
|
|
38
|
+
# @return [ String, nil ] The error_message.
|
|
39
|
+
def error_message
|
|
40
|
+
options[:error_message]
|
|
41
|
+
end
|
|
42
|
+
|
|
30
43
|
# Return the http response body.
|
|
31
44
|
#
|
|
32
45
|
# @example Get response_body.
|
|
@@ -34,7 +47,8 @@ module Typhoeus
|
|
|
34
47
|
#
|
|
35
48
|
# @return [ String ] The response_body.
|
|
36
49
|
def response_body
|
|
37
|
-
options[:response_body] || options[:body]
|
|
50
|
+
body = options[:response_body] || options[:body]
|
|
51
|
+
apply_content_type_charset(body)
|
|
38
52
|
end
|
|
39
53
|
alias :body :response_body
|
|
40
54
|
|
|
@@ -47,13 +61,13 @@ module Typhoeus
|
|
|
47
61
|
def response_headers
|
|
48
62
|
return options[:response_headers] if options[:response_headers]
|
|
49
63
|
if mock? && h = options[:headers]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
status_code = options[:response_code] || options[:code] || 200
|
|
65
|
+
reason_phrase = status_code.to_i == 200 ? "OK" : "Mock Reason Phrase"
|
|
66
|
+
status_line = "HTTP/1.1 #{status_code} #{reason_phrase}"
|
|
67
|
+
actual_headers = h.map{ |k,v| [k, v.respond_to?(:join) ? v.join(',') : v] }.
|
|
68
|
+
map{ |e| "#{e.first}: #{e.last}" }
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
[status_line, *actual_headers].join("\r\n")
|
|
57
71
|
end
|
|
58
72
|
end
|
|
59
73
|
|
|
@@ -67,7 +81,14 @@ module Typhoeus
|
|
|
67
81
|
#
|
|
68
82
|
# @return [ Integer ] The response_code.
|
|
69
83
|
def response_code
|
|
70
|
-
|
|
84
|
+
code = options[:response_code] || options[:code]
|
|
85
|
+
return code.to_i unless code.nil?
|
|
86
|
+
|
|
87
|
+
# A response built from raw headers, such as one returned by
|
|
88
|
+
# #redirections, has no option describing the status.
|
|
89
|
+
line = first_header_line
|
|
90
|
+
status = line && line[/\AHTTP\/\S+\s+(\d{3})/, 1]
|
|
91
|
+
status ? status.to_i : 0
|
|
71
92
|
end
|
|
72
93
|
alias :code :response_code
|
|
73
94
|
|
|
@@ -282,9 +303,9 @@ module Typhoeus
|
|
|
282
303
|
#
|
|
283
304
|
# @return [ Typhoeus::Header ] The response header.
|
|
284
305
|
def headers
|
|
285
|
-
return
|
|
286
|
-
return nil if response_headers.nil?
|
|
287
|
-
@headers
|
|
306
|
+
return @headers if defined?(@headers) && @headers
|
|
307
|
+
return nil if response_headers.nil?
|
|
308
|
+
@headers = Header.new(last_response_block)
|
|
288
309
|
end
|
|
289
310
|
alias :headers_hash :headers
|
|
290
311
|
|
|
@@ -297,7 +318,49 @@ module Typhoeus
|
|
|
297
318
|
# @return [ Array<Typhoeus::Response> ] The redirections
|
|
298
319
|
def redirections
|
|
299
320
|
return [] unless response_headers
|
|
300
|
-
|
|
321
|
+
|
|
322
|
+
http_blocks = response_blocks.select { |block| block.start_with?("HTTP/") }
|
|
323
|
+
blocks = http_blocks.empty? ? response_blocks[0..-2] : http_blocks[0..-2]
|
|
324
|
+
blocks.map { |header| Response.new(:response_headers => header) }
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
private
|
|
328
|
+
|
|
329
|
+
# Split the raw response headers into their header blocks.
|
|
330
|
+
#
|
|
331
|
+
# @return [ Array<String> ] The blocks.
|
|
332
|
+
def response_blocks
|
|
333
|
+
response_headers.to_s.split("\r\n\r\n")
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Return the last block that starts a new response. HTTP/1.1 trailers
|
|
337
|
+
# add a block without a status line after the response headers.
|
|
338
|
+
#
|
|
339
|
+
# @return [ String ] The response block.
|
|
340
|
+
def last_response_block
|
|
341
|
+
http_blocks = response_blocks.select { |block| block.start_with?("HTTP/") }
|
|
342
|
+
(http_blocks.empty? ? response_blocks.last : http_blocks.last).to_s
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Force the body to the charset advertised by the Content-Type
|
|
346
|
+
# header, but leave binary and already encoded bodies alone.
|
|
347
|
+
#
|
|
348
|
+
# @param [ String, nil ] body The response body.
|
|
349
|
+
#
|
|
350
|
+
# @return [ String, nil ] The response body.
|
|
351
|
+
def apply_content_type_charset(body)
|
|
352
|
+
return body unless body.is_a?(String) && !body.frozen?
|
|
353
|
+
return body unless body.encoding == Encoding::BINARY
|
|
354
|
+
|
|
355
|
+
content_type = headers && headers["Content-Type"]
|
|
356
|
+
return body unless content_type
|
|
357
|
+
|
|
358
|
+
charset = content_type.to_s[/;\s*charset\s*=\s*["']?([^"';,\s]+)/i, 1]
|
|
359
|
+
return body unless charset
|
|
360
|
+
|
|
361
|
+
body.force_encoding(Encoding.find(charset))
|
|
362
|
+
rescue ArgumentError
|
|
363
|
+
body
|
|
301
364
|
end
|
|
302
365
|
end
|
|
303
366
|
end
|
data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response/status.rb
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Typhoeus
|
|
2
4
|
class Response
|
|
3
5
|
|
|
@@ -56,7 +58,7 @@ module Typhoeus
|
|
|
56
58
|
#
|
|
57
59
|
# @return [ Boolean ] Return true if failure, false else.
|
|
58
60
|
def failure?
|
|
59
|
-
(mock || return_code
|
|
61
|
+
(mock || !return_code.nil?) && !success?
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
# Return wether the response is modified.
|
|
@@ -83,24 +85,13 @@ module Typhoeus
|
|
|
83
85
|
|
|
84
86
|
# :nodoc:
|
|
85
87
|
def first_header_line
|
|
86
|
-
@first_header_line ||=
|
|
87
|
-
if response_headers.to_s.include?("\r\n\r\n")
|
|
88
|
-
response_headers.to_s.split("\r\n\r\n").last.split("\r\n").first
|
|
89
|
-
else
|
|
90
|
-
response_headers.to_s.split("\r\n").first
|
|
91
|
-
end
|
|
92
|
-
end
|
|
88
|
+
@first_header_line ||= last_response_block.split("\r\n").first
|
|
93
89
|
end
|
|
94
90
|
|
|
95
91
|
# :nodoc:
|
|
96
92
|
def has_good_response_code?
|
|
97
93
|
response_code >= 200 && response_code < 300
|
|
98
94
|
end
|
|
99
|
-
|
|
100
|
-
# :nodoc:
|
|
101
|
-
def has_bad_response_code?
|
|
102
|
-
!has_good_response_code?
|
|
103
|
-
end
|
|
104
95
|
end
|
|
105
96
|
end
|
|
106
97
|
end
|
data/vendor/bundle/ruby/3.2.0/gems/{typhoeus-1.6.0 → typhoeus-1.7.1}/lib/typhoeus/response.rb
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'typhoeus/response/header'
|
|
2
4
|
require 'typhoeus/response/informations'
|
|
3
5
|
require 'typhoeus/response/status'
|
|
@@ -47,6 +49,20 @@ module Typhoeus
|
|
|
47
49
|
@headers = Header.new(options[:headers]) if options[:headers]
|
|
48
50
|
end
|
|
49
51
|
|
|
52
|
+
# Keep duplicated responses independent. Memoization hands a copy of the
|
|
53
|
+
# leader's response to every follower, so shared options, headers, bodies,
|
|
54
|
+
# or callback results would let one request change another one's response.
|
|
55
|
+
def initialize_copy(other)
|
|
56
|
+
super
|
|
57
|
+
@options = duplicate_value(other.options)
|
|
58
|
+
@handled_response = nil
|
|
59
|
+
if other.instance_variable_defined?(:@headers)
|
|
60
|
+
headers = other.instance_variable_get(:@headers)
|
|
61
|
+
@headers = headers.dup if headers
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
private :initialize_copy
|
|
65
|
+
|
|
50
66
|
# Returns whether this request is mocked
|
|
51
67
|
# or not.
|
|
52
68
|
#
|
|
@@ -64,5 +80,24 @@ module Typhoeus
|
|
|
64
80
|
def handled_response
|
|
65
81
|
@handled_response || self
|
|
66
82
|
end
|
|
83
|
+
|
|
84
|
+
private
|
|
85
|
+
|
|
86
|
+
# Duplicate the mutable containers a response may share with its copy.
|
|
87
|
+
# Other option values are opaque and are left alone.
|
|
88
|
+
def duplicate_value(value)
|
|
89
|
+
case value
|
|
90
|
+
when Hash
|
|
91
|
+
value.each_with_object({}) do |(key, nested), copy|
|
|
92
|
+
copy[duplicate_value(key)] = duplicate_value(nested)
|
|
93
|
+
end
|
|
94
|
+
when Array
|
|
95
|
+
value.map { |nested| duplicate_value(nested) }
|
|
96
|
+
when String
|
|
97
|
+
value.dup
|
|
98
|
+
else
|
|
99
|
+
value
|
|
100
|
+
end
|
|
101
|
+
end
|
|
67
102
|
end
|
|
68
103
|
end
|