作者 邓超

x

... ... @@ -40,7 +40,7 @@ class Body {
*/
public function __construct(string $result, Header $header)
{
$this->raw = $result;
$this->raw = trim($result);
$this->header = $header;
... ... @@ -49,11 +49,11 @@ class Body {
$boundary = $this->header->getBoundary();
if($boundary){
$this->parseBoundaryBody($this->raw,$boundary);
}
}else
// 不是多块级
if(stripos($this->header->get('content-type'),'text/')===0){
// if(stripos($this->header->get('content-type'),'text/')===0){
$this->parseRawHtml($this->raw);
}
// }
}
... ... @@ -136,6 +136,10 @@ class Body {
$data->body = explode("\r\n\r\n",$data->body,2)[1];
}
if(!$data->get('content-type')){
$data->set('content-type','text/html');
}
$this->items[] = $this->bodyDeCode($data);
}
... ...