Skip to content

Commit

Permalink
Add "Last-Modified" HTTP header removal
Browse files Browse the repository at this point in the history
  • Loading branch information
gilgil committed Apr 20, 2014
1 parent c0e4621 commit e13f6cc
Showing 1 changed file with 48 additions and 28 deletions.
76 changes: 48 additions & 28 deletions app/websniff/websniffconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,58 @@ HttpSniffConfig::~HttpSniffConfig()

void HttpSniffConfig::addSslStripOutboundDataChange(VDataChange& dataChange)
{
VDataChangeItem item;

item.pattern = "\r\nHost: " + this->sslStripDomainPrefix;
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = "\r\nHost: ";
dataChange.push_back(item);

item.pattern = "http://" + this->sslStripDomainPrefix;
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = "https://";
dataChange.push_back(item);
{
VDataChangeItem item;
item.pattern = "\r\nHost: " + this->sslStripDomainPrefix;
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = "\r\nHost: ";
dataChange.push_back(item);
}

{
VDataChangeItem item;
item.pattern = "http://" + this->sslStripDomainPrefix;
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = "https://";
dataChange.push_back(item);
}
}

void HttpSniffConfig::addSslStripInboundDataChange(VDataChange& dataChange)
{
VDataChangeItem item;

item.pattern = "https://";
item.enabled = true;
item.log = true;
item.replace = qPrintable(QString("http://") + sslStripDomainPrefix);
dataChange.push_back(item);

item.pattern = "; secure";
item.enabled = true;
item.log = true;
item.replace = "";
dataChange.push_back(item);
{
VDataChangeItem item;
item.pattern = "https://";
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = qPrintable(QString("http://") + sslStripDomainPrefix);
dataChange.push_back(item);
}

{
VDataChangeItem item;
item.pattern = "\r\nLast-Modified:[^\r\n]*";
item.syntax = QRegExp::RegExp;
item.enabled = true;
item.log = true;
item.replace = "\r\nLast-Modified-SS:";
dataChange.push_back(item);
}

{
VDataChangeItem item;
item.pattern = "; secure";
item.syntax = QRegExp::FixedString;
item.enabled = true;
item.log = true;
item.replace = "";
dataChange.push_back(item);
}
}

bool HttpSniffConfig::saveToFile(QString fileName)
Expand Down

0 comments on commit e13f6cc

Please sign in to comment.