mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibWeb: Set document content type in load_document()
Fixes regression in `load_document()` compared to FrameLoader.
This commit is contained in:
parent
c437f16cc1
commit
b7c93cae7f
1 changed files with 4 additions and 0 deletions
|
@ -235,6 +235,10 @@ JS::GCPtr<DOM::Document> load_document(Optional<HTML::NavigationParams> navigati
|
|||
|
||||
if (navigation_params->response->body()) {
|
||||
auto process_body = [navigation_params, document](ByteBuffer bytes) {
|
||||
auto extracted_mime_type = navigation_params->response->header_list()->extract_mime_type().release_value_but_fixme_should_propagate_errors();
|
||||
auto mime_type = extracted_mime_type.has_value() ? extracted_mime_type.value().essence().bytes_as_string_view() : StringView {};
|
||||
document->set_content_type(mime_type);
|
||||
|
||||
if (!parse_document(*document, bytes)) {
|
||||
// FIXME: Load html page with an error if parsing failed.
|
||||
TODO();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue