mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03: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
Notes:
sideshowbarker
2024-07-17 03:51:15 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/b7c93cae7f Pull-request: https://github.com/SerenityOS/serenity/pull/21093
@ -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…
Reference in New Issue
Block a user