mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
Sentry: add x-upstream
This commit is contained in:
14
src/Http.cpp
14
src/Http.cpp
@@ -123,17 +123,13 @@ std::string Http::POST(const std::string& host, const std::string& target, const
|
||||
beast::flat_buffer buffer;
|
||||
http::response<http::string_body> response;
|
||||
|
||||
auto BackendName = response.base().find("BeamMP-Endpoint");
|
||||
if (BackendName != response.base().end()) {
|
||||
Application::Console().Write("HTTP POST: BeamMP-Endpoint is " + std::string(BackendName->value()));
|
||||
} else {
|
||||
for (const auto& header : response.base()) {
|
||||
Application::Console().Write(header.name_string().data() + std::string(" = ") + std::string(header.value()));
|
||||
}
|
||||
}
|
||||
|
||||
http::read(stream, buffer, response);
|
||||
|
||||
auto BackendName = response.base().find("x-upstream");
|
||||
if (BackendName != response.base().end()) {
|
||||
Sentry.AddExtra("x-upstream", BackendName->value().data());
|
||||
}
|
||||
|
||||
std::stringstream result;
|
||||
result << response;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user