-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-0.8.52.TRP.patch
33 lines (28 loc) · 1.2 KB
/
nginx-0.8.52.TRP.patch
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
--- nginx-0.8.52/src/core/nginx.h 2010-09-28 02:46:58.000000000 -0400
+++ nginx-0.8.52.TRP/src/core/nginx.h 2010-10-01 18:14:36.000000000 -0400
@@ -9,7 +9,7 @@
#define nginx_version 8052
-#define NGINX_VERSION "0.8.52"
+#define NGINX_VERSION "0.8.52 TRP"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff -rua nginx-0.8.52/src/http/ngx_http_upstream.c nginx-0.8.52.TRP/src/http/ngx_http_upstream.c
--- nginx-0.8.52/src/http/ngx_http_upstream.c 2010-07-28 11:56:56.000000000 -0400
+++ nginx-0.8.52.TRP/src/http/ngx_http_upstream.c 2010-10-04 14:37:46.000000000 -0400
@@ -1581,6 +1581,17 @@
}
}
+ //Rubicon's Referring Header Token Check (RAS or TRP)
+ if((u->headers_in.server != NULL)
+ && !( (strstr((char*)u->headers_in.server->value.data, "RAS") != NULL) ||
+ (strstr((char*)u->headers_in.server->value.data, "TRP") != NULL) )
+ )
+ {
+ fprintf(stderr, "Upstream headers are Server[%s]\n", (char*)u->headers_in.server->value.data);
+ fprintf(stderr, "Declined to cache & serve!\n");
+ return;
+ }
+
if (ngx_http_upstream_process_headers(r, u) != NGX_OK) {
return;
}