mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Assign the Content-Type fetch response header as appropriate
The condition here was inverted.
This commit is contained in:
parent
b04ef436fa
commit
34b446ab34
Notes:
sideshowbarker
2024-07-16 20:31:50 +09:00
Author: https://github.com/trflynn89
Commit: 34b446ab34
Pull-request: https://github.com/SerenityOS/serenity/pull/24138
3 changed files with 21 additions and 1 deletions
|
@ -113,7 +113,7 @@ WebIDL::ExceptionOr<void> Response::initialize_response(ResponseInit const& init
|
|||
m_response->set_body(body->body);
|
||||
|
||||
// 3. If body’s type is non-null and response’s header list does not contain `Content-Type`, then append (`Content-Type`, body’s type) to response’s header list.
|
||||
if (body->type.has_value() && m_response->header_list()->contains("Content-Type"sv.bytes())) {
|
||||
if (body->type.has_value() && !m_response->header_list()->contains("Content-Type"sv.bytes())) {
|
||||
auto header = Infrastructure::Header {
|
||||
.name = MUST(ByteBuffer::copy("Content-Type"sv.bytes())),
|
||||
.value = MUST(ByteBuffer::copy(body->type->span())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue