mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
pro: Warn if credentials will not be considered for Authorization
This commit is contained in:
parent
b5cae5867a
commit
a969eac848
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/winfr34k
Commit: a969eac848
Pull-request: https://github.com/SerenityOS/serenity/pull/16613
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/kuzux ✅
1 changed files with 5 additions and 0 deletions
|
@ -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 = [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue