mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
Now, there is nothing that can react to `set_...()` calls, so offering this possibility can cause wrong assumptions as to what one can do as soon as a WebServer instance has launched. The main program can still decide whether to supply the optional credentials or not, but this way, the configuration can become a Value Object that won't change after initial creation.
30 lines
844 B
C++
30 lines
844 B
C++
/*
|
|
* Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
|
|
* Copyright (c) 2022, Thomas Keppler <serenity@tkeppler.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/DeprecatedString.h>
|
|
#include <AK/Optional.h>
|
|
#include <LibHTTP/HttpRequest.h>
|
|
|
|
namespace WebServer {
|
|
|
|
class Configuration {
|
|
public:
|
|
Configuration(DeprecatedString document_root_path, Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> credentials = {});
|
|
|
|
DeprecatedString const& document_root_path() const { return m_document_root_path; }
|
|
Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> const& credentials() const { return m_credentials; }
|
|
|
|
static Configuration const& the();
|
|
|
|
private:
|
|
DeprecatedString m_document_root_path;
|
|
Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> m_credentials;
|
|
};
|
|
|
|
}
|