Fix the logic of get_url_site(). Also small binding cleanups.

This commit is contained in:
Relintai 2022-08-21 21:37:00 +02:00
parent 46ee607d18
commit b095a48ace

View File

@ -410,7 +410,9 @@ String WebServerRequest::get_url_root_current() const {
String WebServerRequest::get_url_site() const {
String path = get_host();
for (int i = _path_stack_pointer; i < _path_stack.size(); ++i) {
int s = MIN(_path_stack_pointer + 1, _path_stack.size());
for (int i = 0; i < s; ++i) {
path += _path_stack[i];
path += "/";
}
@ -535,8 +537,8 @@ void WebServerRequest::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_file_file_name", "index"), &WebServerRequest::get_file_file_name);
ClassDB::bind_method(D_METHOD("get_file_key", "index"), &WebServerRequest::get_file_key);
ClassDB::bind_method(D_METHOD("get_file_length", "index"), &WebServerRequest::get_file_length);
ClassDB::bind_method(D_METHOD("get_file_data"), &WebServerRequest::get_file_data);
ClassDB::bind_method(D_METHOD("get_file_data_str"), &WebServerRequest::get_file_data_str);
ClassDB::bind_method(D_METHOD("get_file_data", "index"), &WebServerRequest::get_file_data);
ClassDB::bind_method(D_METHOD("get_file_data_str", "index"), &WebServerRequest::get_file_data_str);
ClassDB::bind_method(D_METHOD("get_parameter", "key"), &WebServerRequest::get_parameter);