mirror of
https://github.com/openappsec/openappsec.git
synced 2025-10-02 04:27:43 +03:00
Jun 16th update
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include <unistd.h>
|
||||
#include <sstream>
|
||||
#include <sys/socket.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
@@ -35,6 +34,18 @@ RestConn::~RestConn()
|
||||
{
|
||||
}
|
||||
|
||||
static bool
|
||||
compareStringCaseInsensitive(const string &s1, const string &s2)
|
||||
{
|
||||
if (s1.size() != s2.size()) return false;
|
||||
|
||||
for (size_t index = 0; index < s1.size(); ++index) {
|
||||
if (tolower(s1[index]) != tolower(s2[index])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
RestConn::parseConn() const
|
||||
{
|
||||
@@ -69,7 +80,7 @@ RestConn::parseConn() const
|
||||
os.str(line);
|
||||
string head, data;
|
||||
os >> head >> data;
|
||||
if (boost::iequals(head, "Content-Length:")) {
|
||||
if (compareStringCaseInsensitive(head, "Content-Length:")) {
|
||||
try {
|
||||
len = stoi(data, nullptr);
|
||||
} catch (...) {
|
||||
|
Reference in New Issue
Block a user