remove Request::post_tab and add Request::http_status

Instead of Reqest::post_tab we use now Request::post_in (pt::Space).

Request::http_status will be used instead Request::status,
but at the moment is not changed in all places.
Request::status has been marked as depracated.

While here:
- Check for root dir in App and not in FunctionParser,
let FunctionParser only log the root dir.
- Read post variables after parsing url parameters,
this allows winix functions to set limits
for post input.
- Set limits when parsing input json format, new
options added to config: post_max_object_items, post_max_table_items,
post_max_all_items, post_max_nested_objects.
There are similar options in each winix function (they are in
FunctionBase).
- Some refactoring in App.
- Add config option: log_whole_http_post if true
then the whole parsed post input is logged.
- Add config option: post_json_max - max length of input stream
for parsing json.
- Add config option: templates_request_status, default request_status.html
this is an ezc template used as [content] when the request status
is not 200_ok.
- Fix: Sort winix function didn't show items to sort (fix and do some
refactoring as well)
- Properly sort items in: ImgCrop, Ls, Sort, Upload
- Remove ezc templates: err_404.html, err_per_denied.html - now
request_status.html is used.
This commit is contained in:
2022-05-30 01:29:18 +02:00
parent 9e222f5b80
commit 7d1fb3c04e
46 changed files with 1224 additions and 835 deletions

View File

@@ -72,7 +72,12 @@ void Config::ShowError(const std::wstring & config_file)
break;
case pt::SpaceParser::syntax_error:
log << log1 << "Config: syntax error in file: " << config_file << ", line: " << parser.get_last_parsed_line() << logend;
log << log1 << "Config: syntax error in file: " << config_file << ", line: "
<< parser.get_last_parsed_line() << ":" << parser.get_last_parsed_column() << logend;
break;
default:
// there are no limits sets when parsing the config file
break;
}
}
@@ -142,9 +147,15 @@ void Config::AssignValues()
log_post_value_size = Size(L"log_post_value_size", 80);
log_env_variables = Bool(L"log_env_variables", false);
log_env_http_variables = Bool(L"log_env_http_variables", false);
log_whole_http_post = Bool(L"log_whole_http_post", false);
log_http_answer_headers = Bool(L"log_http_answer_headers", false);
post_file_max = Size(L"post_file_max", 8388608); // 8 MB
post_json_max = Size(L"post_json_max", 8388608); // 8 MB
post_max_object_items = Size(L"post_max_object_items", 1024);
post_max_table_items = Size(L"post_max_table_items", 4096);
post_max_all_items = Size(L"post_max_all_items", 8192);
post_max_nested_objects = Size(L"post_max_nested_objects", 32);
upload_dir = Text(L"upload_dir");
common_dir = Text(L"common_dir");
@@ -177,6 +188,7 @@ void Config::AssignValues()
templates_index = Text(L"templates_index", L"index.html");
templates_index_generic = Text(L"templates_index_generic", L"index_generic.html");
templates_index_raw = Text(L"templates_index_raw", L"index_raw.html");
templates_request_status = Text(L"templates_request_status", L"request_status.html");
template_only_root_use_template_fun = Bool(L"template_only_root_use_template_fun", false);
http_session_id_name = Text(L"http_session_id_name", L"session_id");