blob: 5876cca3bf68aad8a86a4d03bcf7defd19f0f5f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
diff -ur DansGuardian-2.7.6-1/ConnectionHandler.cpp DansGuardian-2.7.6-1-new/ConnectionHandler.cpp
--- DansGuardian-2.7.6-1/ConnectionHandler.cpp 2003-12-03 16:04:18.000000000 -0600
+++ DansGuardian-2.7.6-1-new/ConnectionHandler.cpp 2003-12-03 17:43:36.000000000 -0600
@@ -990,6 +990,11 @@
else if (o.reporting_level == -1) { // stealth
(*checkme).isItNaughty = false; // dont block
}
+ else if (o.reporting_level == -2) { // just add a header
+ (*docheader).addXNaughty("true", (*checkme).whatIsNaughty.c_str(), (*url).toCharArray());
+ (*checkme).isItNaughty = false; // dont block
+ }
+
} catch (exception& e) {}
if ((*checkme).isItNaughty) { // not stealth mode then
try {
diff -ur DansGuardian-2.7.6-1/HTTPHeader.cpp DansGuardian-2.7.6-1-new/HTTPHeader.cpp
--- DansGuardian-2.7.6-1/HTTPHeader.cpp 2003-12-03 16:04:18.000000000 -0600
+++ DansGuardian-2.7.6-1-new/HTTPHeader.cpp 2003-12-03 17:38:09.000000000 -0600
@@ -456,6 +456,17 @@
header.push_back(String(line.c_str()));
}
+void HTTPHeader::addXNaughty(std::string naughty, std::string whatIsNaughty, std::string whereIsNaughty) {
+ std::string line;
+
+ line = "X-Naughty: " + naughty + "\r";
+ header.push_back(String(line.c_str()));
+ line = "X-Naughty-Why: " + whatIsNaughty + "\r";
+ header.push_back(String(line.c_str()));
+ line = "X-Naughty-Where: " + whereIsNaughty + "\r";
+ header.push_back(String(line.c_str()));
+}
+
void HTTPHeader::setTimeout(int t) {
timeout = t;
}
diff -ur DansGuardian-2.7.6-1/HTTPHeader.hpp DansGuardian-2.7.6-1-new/HTTPHeader.hpp
--- DansGuardian-2.7.6-1/HTTPHeader.hpp 2003-12-03 16:04:18.000000000 -0600
+++ DansGuardian-2.7.6-1-new/HTTPHeader.hpp 2003-12-03 17:38:09.000000000 -0600
@@ -43,6 +43,7 @@
std::string getXForwardedForIP();
void setTimeout(int t);
void addXForwardedFor(std::string clientip);
+ void addXNaughty(std::string naughty, std::string whatIsNaughty, std::string whereIsNaughty);
bool isCompressed();
String contentEncoding();
void removeEncoding(int newlen);
|