Test for <html in $body instead of data

When the response includes `<html`, it is split into `$head` (`<head>`) and `$body` (`<body>`), but `$body` is currently ignored if `data` includes `<html`.