- allow_all_cors_origins - whether or not to allow all origins
- allowed_cors_origins - a list of allowed origins (used if allow_all_cors_origins is false)
The session cookie was not created because request->session pointed at
a temporary session.
While here:
- do some cleaning in App
- set request->mount too
- add fcgi_cannot_create_request_delay to the config
- fix: in mailregister plugin get model_connector from env (and not from the request)
Now we allow a request to be passed into a job queue,
and after the job finishes the request is passed into
a controller again. In order to achieve this we have
a requests queue in System, when we put a request
to the job this Request structure is preserved in the
queue and for a new request a new Request is added to
the queue.
while here:
- remove App::Lock()/Unlock(), use scoped locking
- fix: Plugin now has a Call method which takes ModelConnector
and a logger (used in multithreaded environment)
- BaseThread has a main_model_connector pointer
to the main (from the main thread) model connector
- the FastCGI structure fcgi_request moved from App to Request
- some methods for handling requests moved from App to Request
- small refactoring in main.cpp
- add Http class (a http client)
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.
In PostParser we add some prefix with a number if the name of a variable is the same,
we should use zero padding for the number to be correctly sorted.
add config options:
db_startup_connection_max_attempts - default 0 (infinite)
db_startup_connection_attempt_delay - delay in seconds between attempts (default 5)
BREAKING CHANGE: WINIX_PLUGIN_INIT plugin message requires to set result status,
you have to set the result status to true (env.res) if your
plugin was initialized correctly, otherwise winix will not start
Added methods:
void AddParam(const std::wstring & param_name, const std::wstring & param_value);
void AddParam(const wchar_t * param_name, const wchar_t * param_value);
void RemoveParam(const wchar_t * param_name);
void RemoveParam(const std::wstring & param_name);
This is only temporarily, we will be using the pt::Space structure in the future.
Environment variables must be prefixed with winix_ to be loaded by winix.
The winix_ prefix is then removed and the key value converted to lowercase.
Sample:
evn WINIX_MY_OPTION=TEST123test winix -c config_file
This will add my_option to the config with value TEST123test.
Environment variables are read last so they will overwrite the values
from the configuration files.
Usage: winix [options]
-c : a path to the config file
--config : a path to the config file
-h : print usage information
--help : print usage information
-? : print usage information
While here:
- let it be possible to parse multiple configs,
- fix: some error messages were not printed at startup.
now winix can return json, xml, csv from out_main_stream or from frames and json from models
removed from Request:
bool send_bin_stream
bool return_json
bool return_info_only
pt::Space info
bool page_generated
bool out_main_stream_use_html_filter
bool out_streams_use_html_filter
added to Request:
enum AnswerSource
enum AnswerContainer
AnswerSource answer_source
AnswerContainer answer_container
bool use_ezc_engine
std::wstring frame
bool send_all_frames
bool use_html_filter
added to Config:
// the name of the url parameter for returning all frames, e.g. https://domain.tld/mydir/myfunction/allframes
// default: allframes
std::wstring request_all_frames_parameter;
// the name of the root element when serializing request answer to xml
// default: winix
std::wstring xml_root;
algorithm (the whole algorithm is described in core/request.h):
at the beginning of a request winix sets
answer_source to models
answer_container to text
use_ezc_engine to true
next answer_container and use_ezc_engine can be changed in the following way:
1. winix will look for 'Accept' http header and depending on the header winix will set:
(not implemented yet)
Accept | answer_container | use_ezc_engine
------------------------------------|-----------------
application/json | json | false
application/xml | xml | false
text/csv | csv | false
2. next answer_container is set depending on 'container' url parameter
container | answer_container
---------------------------------------------------------
not present | don't change the value
text | text
json | json
xml | xml
csv | csv
use_ezc_engine is set depending on 'answer' url parameter:
answer | use_ezc_engine
---------------------------------
not present | don't change the value
html | true
data | false
if 'answer' is html then we take into account two more parameters:
frame: frame_name (empty default) - if set then winix returns this specific frame
allframes: (if present then winix returns all frames)
added: std::wstring file_mime_type to ItemContent - a mime type for static file
added: Header (core/header.h) - there will be header names defined, at the moment only content_type
added: FuncionsBase::Finish() - it is called at the end when the winix finishes
0 - winix will read the content of the file and send it back to the webserver
1 - winix will use send_file_header header with a full path to the file
2 - winix will use send_file_header header with a relative path to the file
added to config:
int send_file_mode;
// 0 - full path to a file in send_file_header header
// 1 - relative path to a file in send_file_header (need http_send_file_relative_prefix set) (used for nginx)
std::wstring send_file_header;
// default: X-SENDFILE
// for Apache set: X-SENDFILE
// for Lighttpd set: X-LIGHTTPD-send-file
// for Nginx set: X-Accel-Redirect
std::wstring send_file_relative_prefix;
// relative prefix used for sending static files if send_file_mode is 1
// default: "upload-files-internal"