Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Http {
static const std::vector<std::string> passwdFields;
static const std::vector<std::string> sessionFields;

bool IsContainFields(std::string content, std::vector<std::string> fields);
static bool IsContainFields(const std::string &content, const std::vector<std::string> &fields);

std::string method_;
std::string path_;
Expand Down
8 changes: 4 additions & 4 deletions src/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ bool Http::IsCredz()
IsContainFields(cookie_, sessionFields);
}

bool Http::IsContainFields(string content, vector<string> fields)
bool Http::IsContainFields(const string &content, const vector<string> &fields)
{
boost::algorithm::to_lower(content);
for (auto &field : fields) {
if (string::npos != content.find(field)) {
auto lower_content = boost::to_lower_copy<string>(content);
for (const auto &field : fields) {
if (string::npos != lower_content.find(field)) {
return true;
}
}
Expand Down