From 92830172f94f450ae1c0c6eecadf0a60dd88a753 Mon Sep 17 00:00:00 2001 From: o Date: Fri, 22 Jan 2016 16:08:54 +0500 Subject: [PATCH] asdf --- HTTPProxy.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/HTTPProxy.cpp b/HTTPProxy.cpp index 12d2c765..c5466d4f 100644 --- a/HTTPProxy.cpp +++ b/HTTPProxy.cpp @@ -183,6 +183,19 @@ namespace proxy bool HTTPProxyHandler::HandleData(uint8_t *http_buff, std::size_t len) { assert(len); // This should always be called with a least a byte left to parse + + + // remove "Referer" from http requst + http_buff[len] = '\0'; + char *start = strstr((char *)http_buff, "\nReferer:"); + if (start!=0) + { + char *end = strstr(start+1, "\n"); + strncpy(start, end, (char*)(http_buff + len) - end); + len = len - (end - start); + } + + while (len > 0) { //TODO: fallback to finding HOst: header if needed