60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
/* This file is part of FediBlock-backend.
|
|
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include "cgi.hpp"
|
|
#include "json.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
using std::cout;
|
|
|
|
using namespace FediBlock;
|
|
|
|
void print_debug()
|
|
{
|
|
cout << "\r\n\r\nDEBUG:\r\n";
|
|
|
|
const entry_type entry{parse_formdata()};
|
|
|
|
cout << " Instance: " << entry.instance << "\r\n";
|
|
cout << " Tags:";
|
|
for (const auto &tag : entry.tags)
|
|
{
|
|
cout << " " << tag;
|
|
}
|
|
cout << "\r\n";
|
|
cout << " Receipts:";
|
|
for (const auto &receipt : entry.receipts)
|
|
{
|
|
cout << " " << receipt;
|
|
}
|
|
cout << "\r\n";
|
|
cout << " Description: " << entry.description << "\r\n";
|
|
|
|
cout << "\r\n\r\nJSON:\r\n";
|
|
cout << to_json(entry) << "\r\n";
|
|
}
|
|
|
|
int main()
|
|
{
|
|
cout << "Content-Type: text/plain; charset=utf-8\r\n\r\n";
|
|
cout << "Received and filed to /dev/null. 😝\r\n";
|
|
|
|
print_debug();
|
|
|
|
return 0;
|
|
}
|