mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +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 (...) {
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include "debug.h"
|
||||
#include "rest_conn.h"
|
||||
#include "i_rest_invoke.h"
|
||||
#include "sasal.h"
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
@@ -33,8 +32,6 @@ USE_DEBUG_FLAG(D_API);
|
||||
static const int listen_limit = 100;
|
||||
static const chrono::milliseconds bind_retry_interval_msec = chrono::milliseconds(500);
|
||||
|
||||
SASAL_START // REST Server
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class RestServer::Impl
|
||||
@@ -257,5 +254,3 @@ RestServer::preload()
|
||||
registerExpectedConfiguration<uint>("connection", "Nano service API Port Range start");
|
||||
registerExpectedConfiguration<uint>("connection", "Nano service API Port Range end");
|
||||
}
|
||||
|
||||
SASAL_END
|
||||
|
Reference in New Issue
Block a user