1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

pro: Warn if credentials will not be considered for Authorization

This commit is contained in:
Thomas Keppler 2022-12-21 16:24:47 +01:00 committed by Ali Mohammad Pur
parent b5cae5867a
commit a969eac848

View file

@ -255,6 +255,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto const encoded_credentials = TRY(encode_base64(credentials.bytes()));
auto const authorization = TRY(String::formatted("Basic {}", encoded_credentials));
request_headers.set("Authorization", authorization.to_deprecated_string());
} else {
if (is_http_url && has_credentials && has_manual_authorization_header)
warnln("* Skipping encoding provided authorization, manual header present.");
if (!is_http_url && has_credentials)
warnln("* Skipping adding Authorization header, request was not for the HTTP protocol.");
}
Function<void()> setup_request = [&] {