#ifndef WEB_ROOT_H #define WEB_ROOT_H #include "core/hash_map.h" #include "core/os/mutex.h" #include "core/ustring.h" #include "core/vector.h" #include "web_node.h" #include "web_server_middleware.h" class WebServerRequest; class FileCache; class WebRoot : public WebNode { GDCLASS(WebRoot, WebNode); public: String get_www_root_path(); void set_www_root_path(const String &val); Ref get_www_root_file_cache(); Vector get_middlewares(); void set_middlewares(const Vector &data); void _handle_request_main(Ref request); void _handle_error_send_request(Ref request, const int error_code); bool process_middlewares(Ref request); bool try_send_wwwroot_file(Ref request); void send_file(const String &path, Ref request); void register_request_update(Ref request); void unregister_request_update(Ref request); WebRoot(); ~WebRoot(); Vector> _middlewares; protected: void _notification(int p_what); static void _bind_methods(); Mutex _update_registered_requests_mutex; Vector> _update_registered_requests; String _www_root_path; Ref _www_root_file_cache; }; #endif