/* * Copyright (c) 2026, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include namespace RequestServer { struct ResourceSubstitution { ByteString file_path; Optional content_type; u32 status_code { 200 }; }; class ResourceSubstitutionMap { public: static ErrorOr> load_from_file(StringView path); Optional lookup(URL::URL const&) const; ErrorOr for_each_substitution(Function(ResourceSubstitution const&)> const&) const; private: ResourceSubstitutionMap() = default; HashMap m_substitutions; }; extern OwnPtr g_resource_substitution_map; }