diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:57 +0900 |
| commit | f31b101ce1e921a026ba234b1f0a83b0392bc118 (patch) | |
| tree | b7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe/src/util/http/response.rs | |
| parent | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff) | |
| download | php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip | |
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/http/response.rs')
| -rw-r--r-- | crates/shirabe/src/util/http/response.rs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/http/response.rs b/crates/shirabe/src/util/http/response.rs index 62458d6..ef86ec9 100644 --- a/crates/shirabe/src/util/http/response.rs +++ b/crates/shirabe/src/util/http/response.rs @@ -82,8 +82,16 @@ impl Response { let mut value = None; let pattern = format!("(?i)^{}:\\s*(.+?)\\s*$", preg_quote(name, None)); for header in headers { - if let Some(m) = Preg::match_(&pattern, header) { - value = Some(m[1].clone()); + let mut matches: indexmap::IndexMap< + shirabe_external_packages::composer::pcre::preg::CaptureKey, + String, + > = indexmap::IndexMap::new(); + if Preg::match3(&pattern, header, Some(&mut matches)).unwrap_or(false) { + if let Some(s) = matches + .get(&shirabe_external_packages::composer::pcre::preg::CaptureKey::ByIndex(1)) + { + value = Some(s.clone()); + } } } value @@ -94,7 +102,16 @@ impl Response { todo!() } - pub fn new_fake(_body: Option<String>) -> Self { + pub fn to_php_mixed(&self) -> PhpMixed { + todo!() + } + + pub fn new_fake( + _url: &str, + _code: i64, + _headers: IndexMap<String, PhpMixed>, + _body: String, + ) -> Self { todo!() } } |
