- added to Request: is_htmx_request (bool) - true if the request is made by htmx library (ajax)

- commented out using mount_page_arg_is "subject" and "info" from fun_cat.html and fun_run.html - they will be removed soon
- some improvements in fun_reply.html, fun_showthreads.html and fun_thread.html (scrolling)
This commit is contained in:
2021-05-31 10:58:34 +02:00
parent e6fae4598c
commit 22de3322ae
18 changed files with 112 additions and 34 deletions

View File

@@ -940,6 +940,7 @@ void App::ReadRequest()
CheckIE();
CheckKonqueror();
CheckHtmx();
if( cur.request->using_ssl )
log << log3 << "App: connection secure through SSL" << logend;
@@ -1125,6 +1126,15 @@ void App::CheckSSL()
}
void App::CheckHtmx()
{
// fastcgi will change the header to hx_request
cur.request->is_htmx_request = (cur.request->headers_in.has_key(L"HX-Request") || cur.request->headers_in.has_key(L"hx_request"));
}
void App::SetSubdomain()
{
CreateSubdomain(config.base_url.c_str(), cur.request->env_http_host.c_str(), cur.request->subdomain);
@@ -1801,7 +1811,7 @@ size_t output_size = 0;
source = &json_out_stream.Str(); // json_out_stream was prepared by CreateJSONAnswer()
}
else
if( cur.request->headers_in.has_key(L"HX-Request") || cur.request->headers_in.has_key(L"hx_request") ) // fastcgi will change the header to hx_request
if( cur.request->is_htmx_request )
{
source = CreateFrameAnswer();

View File

@@ -230,6 +230,7 @@ private:
void CheckKonqueror();
void CheckRequestMethod();
void CheckSSL();
void CheckHtmx();
void SetSubdomain();

View File

@@ -134,6 +134,7 @@ void Request::Clear()
send_as_attachment = false;
using_ssl = false;
is_htmx_request = false;
start_time = 0;
start_date.Clear();

View File

@@ -170,6 +170,8 @@ struct Request
// true if we are using an encrypted connection (SSL)
bool using_ssl;
// true if the request is being made by ajax by htmx library
bool is_htmx_request;
/*
request input variables representing the winix filesystem