mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Support for Content-Language HTTP header
This commit is contained in:
@@ -369,6 +369,12 @@ WebIDL::ExceptionOr<GC::Ref<Document>> Document::create_and_initialize(Type type
|
||||
if (auto maybe_last_modified = navigation_params.response->header_list()->get("Last-Modified"sv.bytes()); maybe_last_modified.has_value())
|
||||
document->m_last_modified = Core::DateTime::parse("%a, %d %b %Y %H:%M:%S %Z"sv, maybe_last_modified.value());
|
||||
|
||||
// NOTE: Non-standard: Pull out the Content-Language header to determine the document's language.
|
||||
if (auto maybe_http_content_language = navigation_params.response->header_list()->get("Content-Language"sv.bytes()); maybe_http_content_language.has_value()) {
|
||||
if (auto maybe_content_language = String::from_utf8(maybe_http_content_language.value()); !maybe_content_language.is_error())
|
||||
document->m_http_content_language = maybe_content_language.release_value();
|
||||
}
|
||||
|
||||
// 10. Set window's associated Document to document.
|
||||
window->set_associated_document(*document);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user