mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Process Base64 data URLs with the forgiving Base64 algorithm
This commit is contained in:
parent
24ecf31ff5
commit
74377618b1
Notes:
sideshowbarker
2024-07-17 06:24:08 +09:00
Author: https://github.com/trflynn89
Commit: 74377618b1
Pull-request: https://github.com/SerenityOS/serenity/pull/23699
Issue: https://github.com/SerenityOS/serenity/issues/23689
1 changed files with 2 additions and 3 deletions
|
@ -6,9 +6,9 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Base64.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/URL.h>
|
||||
#include <Userland/Libraries/LibWeb/Infra/Base64.h>
|
||||
|
||||
namespace Web::Fetch::Infrastructure {
|
||||
|
||||
|
@ -77,9 +77,8 @@ ErrorOr<DataURL> process_data_url(URL::URL const& data_url)
|
|||
auto string_body = StringView(body);
|
||||
|
||||
// 2. Set body to the forgiving-base64 decode of stringBody.
|
||||
// FIXME: Check if it's really forgiving.
|
||||
// 3. If body is failure, then return failure.
|
||||
body = TRY(decode_base64(string_body));
|
||||
body = TRY(Infra::decode_forgiving_base64(string_body));
|
||||
|
||||
// 4. Remove the last 6 code points from mimeType.
|
||||
// 5. Remove trailing U+0020 SPACE code points from mimeType, if any.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue