mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +03:00
Feb 10 2025 dev (#255)
* sync code * sync code * code sync * code sync --------- Co-authored-by: Ned Wright <nedwright@proton.me> Co-authored-by: Daniel Eisenberg <danielei@checkpoint.com>
This commit is contained in:
@@ -79,7 +79,8 @@ HTTPRequest::prepareRequest(
|
||||
HTTPMethod method,
|
||||
const string &uri,
|
||||
const map<string, string> &headers,
|
||||
const string &body
|
||||
const string &body,
|
||||
const bool should_send_access_token
|
||||
)
|
||||
{
|
||||
HTTPRequest req(method, uri, headers, body);
|
||||
@@ -94,6 +95,7 @@ HTTPRequest::prepareRequest(
|
||||
dont_add_access_token = true;
|
||||
dbgTrace(D_MESSAGING) << "Request is for agent authentication";
|
||||
}
|
||||
if (!should_send_access_token) dont_add_access_token = true;
|
||||
auto res = req.addAccessToken(conn, dont_add_access_token);
|
||||
if (!res.ok()) return res.passErr();
|
||||
|
||||
|
@@ -142,7 +142,13 @@ MessagingComp::sendMessage(
|
||||
metadata.insertHeaders(i_env->getCurrentHeadersMap());
|
||||
}
|
||||
|
||||
auto req = HTTPRequest::prepareRequest(conn, method, uri, metadata.getHeaders(), body);
|
||||
auto req = HTTPRequest::prepareRequest(
|
||||
conn,
|
||||
method,
|
||||
uri,
|
||||
metadata.getHeaders(),
|
||||
body,
|
||||
metadata.shouldSendAccessToken());
|
||||
if (!req.ok()) return genError(HTTPResponse(HTTPStatusCode::HTTP_UNKNOWN, req.getErr()));
|
||||
|
||||
auto response = i_conn->sendRequest(conn, *req);
|
||||
|
Reference in New Issue
Block a user