Expose FileCache in FolderServeWebPage to scripts.

This commit is contained in:
Relintai 2024-05-04 16:13:02 +02:00
parent 225bfef3e6
commit 61cecf068a
2 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,10 @@ void FolderServeWebPage::set_serve_folder(const String &val) {
_serve_folder = val;
}
Ref<FileCache> FolderServeWebPage::get_file_cache() const {
return _file_cache;
}
void FolderServeWebPage::_handle_request_main(Ref<WebServerRequest> request) {
if (_web_permission.is_valid()) {
if (_web_permission->activate(request)) {
@ -100,5 +104,7 @@ void FolderServeWebPage::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_serve_folder", "val"), &FolderServeWebPage::set_serve_folder);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "serve_folder"), "set_serve_folder", "get_serve_folder");
ClassDB::bind_method(D_METHOD("get_file_cache"), &FolderServeWebPage::get_file_cache);
ClassDB::bind_method(D_METHOD("load"), &FolderServeWebPage::load);
}

View File

@ -52,6 +52,8 @@ public:
String get_serve_folder();
void set_serve_folder(const String &val);
Ref<FileCache> get_file_cache() const;
void _handle_request_main(Ref<WebServerRequest> request);
virtual void load();