1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibWeb: Make WindowOrWorkerGlobalScope#atob use forgiving base64 decode

This was forgotten to be changed when Window's atob was updated to use
forgiving base64 decode.
This commit is contained in:
Luke Wilde 2023-03-07 18:43:32 +00:00 committed by Linus Groh
parent b91b67f4f3
commit cdc77407bf

View file

@ -12,6 +12,7 @@
#include <LibTextCodec/Decoder.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
#include <LibWeb/Infra/Base64.h>
#include <LibWeb/WebIDL/DOMException.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
@ -69,7 +70,7 @@ WebIDL::ExceptionOr<String> WindowOrWorkerGlobalScopeMixin::atob(String const& d
auto& realm = *vm.current_realm();
// 1. Let decodedData be the result of running forgiving-base64 decode on data.
auto decoded_data = decode_base64(data.bytes_as_string_view());
auto decoded_data = Infra::decode_forgiving_base64(data.bytes_as_string_view());
// 2. If decodedData is failure, then throw an "InvalidCharacterError" DOMException.
if (decoded_data.is_error())