作者 邓超

body bug

@@ -508,27 +508,10 @@ class Body { @@ -508,27 +508,10 @@ class Body {
508 * @time 2022/8/12 10:26 508 * @time 2022/8/12 10:26
509 */ 509 */
510 private function preg_match_type($item){ 510 private function preg_match_type($item){
511 - $items = explode("\n",$item);  
512 - $ctstr = '';  
513 - foreach ($items as $str){  
514 - if($ctstr){  
515 -  
516 - if(str_starts_with($str, "\t")){  
517 - $ctstr .= $str."\n";  
518 - }else{  
519 - break;  
520 - }  
521 - }  
522 -  
523 - if(str_starts_with($str, 'Content-Type:')){  
524 - $ctstr .= $str."\n";  
525 - }  
526 -  
527 - }  
528 511
529 // 匹配内容 type 512 // 匹配内容 type
530 // preg_match("/Content-Type:[\w\W].*/i",$item,$result); 513 // preg_match("/Content-Type:[\w\W].*/i",$item,$result);
531 - $result[0] = $ctstr; 514 + $result[0] = $this->getTag($item,'Content-Type:');
532 if(!empty($result[0])){ 515 if(!empty($result[0])){
533 $ret['origin'] = trim($result[0]); 516 $ret['origin'] = trim($result[0]);
534 // type 517 // type