mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
WebServer: Add support for HTTP basic authentication
This enables the WebServer to run protected by a username and password. While it isn't possible to access such a protected server from inside Serenity as of now (because neither the Browser nor pro(1) support this), this may very well be the case in the future. :^)
This commit is contained in:
parent
1d990b3e7b
commit
79a47d9bd3
Notes:
sideshowbarker
2024-07-18 12:26:20 +09:00
Author: https://github.com/MaxWipfli
Commit: 79a47d9bd3
Pull-request: https://github.com/SerenityOS/serenity/pull/7879
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gunnarbeutner
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/stelar7
4 changed files with 53 additions and 4 deletions
|
@ -6,7 +6,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibHTTP/HttpRequest.h>
|
||||
|
||||
namespace WebServer {
|
||||
|
||||
|
@ -15,13 +17,16 @@ public:
|
|||
Configuration(String root_path);
|
||||
|
||||
String const& root_path() const { return m_root_path; }
|
||||
Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> const& credentials() const { return m_credentials; }
|
||||
|
||||
void set_root_path(String root_path) { m_root_path = move(root_path); }
|
||||
void set_credentials(Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> credentials) { m_credentials = move(credentials); }
|
||||
|
||||
static Configuration const& the();
|
||||
|
||||
private:
|
||||
String m_root_path;
|
||||
Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> m_credentials;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue