From 71e5d9c33393cd7a035b8f508821ac7730046812 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sat, 20 Aug 2016 18:36:46 +0800 Subject: [PATCH] crowler blocking added to home page --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.cpp b/main.cpp index 01aa8b3..472fd6e 100644 --- a/main.cpp +++ b/main.cpp @@ -106,6 +106,14 @@ int main(int ac, const char* av[]) { //for (const auto& m : req.headers) // cout << m.first << ": " << m.second << endl; + // there is some robot scanning everything + // on the explorer. I block it with this + if (!xmreg::does_header_has(req, "Accept", "q=.2, */*; q=.2").empty()) + { + cout << "Scanner with q=.2, */*; q=.2 blocked!" << endl; + return crow::response(400); + } + return xmrblocks.index2(); });