diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 20:19:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 20:20:47 +0900 |
| commit | 40bb49fc0b80d5ff97875903b2c2e55ff394cecc (patch) | |
| tree | b4ac82245573b6905f216116d9bc88bfc7e0d51e /crates/shirabe/src/util/stream_context_factory.rs | |
| parent | e63ccb5cbb479df0f0e5010065ff57bbf4ca238f (diff) | |
| download | php-shirabe-40bb49fc0b80d5ff97875903b2c2e55ff394cecc.tar.gz php-shirabe-40bb49fc0b80d5ff97875903b2c2e55ff394cecc.tar.zst php-shirabe-40bb49fc0b80d5ff97875903b2c2e55ff394cecc.zip | |
refactor(http): present reqwest instead of faking curl_version
- StreamContextFactory: User-Agent reports the HTTP stack as "reqwest"
- RequestProxy::supports_secure_proxy: always true (reqwest+rustls can always
TLS to a proxy); drop the now-dead curl<7.52 guard in get_curl_options
- DiagnoseCommand::get_curl_version: phase-D TODO placeholder
Empirically verified: reqwest sends no default User-Agent (shirabe sets it
explicitly) and accepts https:// proxy URLs. init+install output stays
byte-identical to Composer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/stream_context_factory.rs')
| -rw-r--r-- | crates/shirabe/src/util/stream_context_factory.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/shirabe/src/util/stream_context_factory.rs b/crates/shirabe/src/util/stream_context_factory.rs index 1747cd6..0b259d7 100644 --- a/crates/shirabe/src/util/stream_context_factory.rs +++ b/crates/shirabe/src/util/stream_context_factory.rs @@ -4,8 +4,8 @@ use indexmap::IndexMap; use shirabe_external_packages::composer::ca_bundle::CaBundle; use shirabe_php_shim::{ HHVM_VERSION, PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PhpMixed, - array_replace_recursive, curl_version, extension_loaded, function_exists, php_uname, - stream_context_create, stripos, uasort, + array_replace_recursive, extension_loaded, function_exists, php_uname, stream_context_create, + stripos, uasort, }; use crate::composer; @@ -159,15 +159,11 @@ impl StreamContextFactory { }; let http_version = if for_curl { - let curl = curl_version().unwrap_or_default(); - let version = curl - .get("version") - .and_then(|v| v.as_string()) - .unwrap_or("") - .to_string(); - format!("cURL {}", version) + // PHP reports `cURL <version>` here. Shirabe's "curl" transport is backed by reqwest, + // so name reqwest as the HTTP stack in the User-Agent. + "reqwest" } else { - "streams".to_string() + "streams" }; let has_user_agent = options |
