mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Support for Content-Language
HTTP header
This commit is contained in:
parent
dda1573746
commit
c9edb6ffc4
Notes:
github-actions[bot]
2025-02-19 10:54:32 +00:00
Author: https://github.com/pbrw
Commit: c9edb6ffc4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3255
Reviewed-by: https://github.com/shannonbooth ✅
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 51 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue