mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
yhook: introduce new format for plain output; key=value
Origin commit data
------------------
Commit: 4c679613d6
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-20 (Sat, 20 Feb 2016)
Origin message was:
------------------
- yhook: introduce new format for plain output; key=value
This commit is contained in:
@@ -28,6 +28,7 @@ CyhookHandler::CyhookHandler()
|
||||
Method = M_UNKNOWN;
|
||||
httpStatus = HTTP_NIL;
|
||||
outType = plain;
|
||||
outSingle = false;
|
||||
LastModified=0;
|
||||
}
|
||||
|
||||
@@ -405,7 +406,8 @@ TOutType CyhookHandler::checkOutput() {
|
||||
return outType;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
TOutType CyhookHandler::outStart() {
|
||||
TOutType CyhookHandler::outStart(bool single) {
|
||||
outSingle = single; // for compatibility
|
||||
// get outType
|
||||
outType = plain; // plain
|
||||
if (ParamList["format"] == "json")
|
||||
@@ -440,7 +442,13 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool
|
||||
result += "\n";
|
||||
break;
|
||||
default:
|
||||
result = _content;
|
||||
if (outSingle)
|
||||
result = _content;
|
||||
else
|
||||
{
|
||||
result = _key + "=" + _content;
|
||||
result += "\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user