tmp show headers

master
moneroexamples 8 years ago
parent 3c9e75835c
commit 6d3ca3d531

@ -139,9 +139,6 @@ int main(int ac, const char* av[]) {
CROW_ROUTE(app, "/block/<string>") CROW_ROUTE(app, "/block/<string>")
([&](const crow::request& req, string block_hash) { ([&](const crow::request& req, string block_hash) {
for (const auto& m : req.headers)
cout << m.first << ": " << m.second << endl;
// there is some robot scanning everything // there is some robot scanning everything
// on the explorer. I block it with this // on the explorer. I block it with this
if (!xmreg::does_header_has(req, "Accept", "q=.2, */*; q=.2").empty()) if (!xmreg::does_header_has(req, "Accept", "q=.2, */*; q=.2").empty())
@ -156,6 +153,10 @@ int main(int ac, const char* av[]) {
CROW_ROUTE(app, "/tx/<string>") CROW_ROUTE(app, "/tx/<string>")
([&](const crow::request& req, string tx_hash) { ([&](const crow::request& req, string tx_hash) {
for (const auto& m : req.headers)
cout << m.first << ": " << m.second << endl;
// there is some robot scanning everything // there is some robot scanning everything
// on the explorer. I block it with this // on the explorer. I block it with this
if (!xmreg::does_header_has(req, "Accept", "q=.2, */*; q=.2").empty()) if (!xmreg::does_header_has(req, "Accept", "q=.2, */*; q=.2").empty())

Loading…
Cancel
Save