don't check for request->is_htmx_request for sending frames, check only "frame" url paremeter
added config parameter: request_frame_parameter, default: "frame"
This commit is contained in:
@@ -780,13 +780,16 @@ pt::WTextStream * App::CreateFrameAnswer()
|
||||
{
|
||||
Request & req = *cur.request;
|
||||
auto i = req.out_streams.streams_map.begin();
|
||||
const std::wstring * frame = cur.request->ParamValuep(L"frame");
|
||||
const std::wstring * frame = cur.request->ParamValuep(config.request_frame_parameter);
|
||||
|
||||
for( ; i != req.out_streams.streams_map.end() ; ++i)
|
||||
if( frame )
|
||||
{
|
||||
if( (frame && i->first == *frame) || (!frame && i->first == L"content") )
|
||||
for( ; i != req.out_streams.streams_map.end() ; ++i)
|
||||
{
|
||||
return &i->second->get_buffer();
|
||||
if( i->first == *frame )
|
||||
{
|
||||
return &i->second->get_buffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1904,6 +1907,16 @@ return header;
|
||||
}
|
||||
|
||||
|
||||
bool App::IsRequestedFrame()
|
||||
{
|
||||
if( !config.request_frame_parameter.empty() )
|
||||
{
|
||||
return cur.request->ParamValuep(config.request_frame_parameter);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void App::SendTextAnswer()
|
||||
{
|
||||
@@ -1923,12 +1936,13 @@ size_t output_size = 0;
|
||||
*/
|
||||
FilterContent();
|
||||
|
||||
// cur.request->return_json is depracated, we will create json from models/space registered through request->models object
|
||||
if( cur.request->return_json )
|
||||
{
|
||||
source = CreateJSONAnswer();
|
||||
}
|
||||
else
|
||||
if( cur.request->is_htmx_request )
|
||||
if( IsRequestedFrame() )
|
||||
{
|
||||
source = CreateFrameAnswer();
|
||||
|
||||
|
Reference in New Issue
Block a user