Skip to content

Commit 106e863

Browse files
committed
1120 Trace URI on CRITICAL message Response
Trace URI on CRITICAL message Response content provided but code was no-content or not_modified. Signed-off-by: Abiola Asojo <abiola.asojo@ibm.com>
1 parent f2eb4ef commit 106e863

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

http/http2_connection.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ class HTTP2Connection :
207207

208208
completeResponseFields(stream.accept, res);
209209
res.addHeader(boost::beast::http::field::date, getCachedDateStr());
210-
res.preparePayload();
210+
crow::Request& thisReq = *it->second.req;
211+
res.preparePayload(thisReq.url().path());
211212

212213
boost::beast::http::fields& fields = res.fields();
213214
std::string code = std::to_string(res.resultInt());

http/http_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ class Connection :
849849
void doWrite()
850850
{
851851
BMCWEB_LOG_DEBUG("{} doWrite", logPtr(this));
852-
res.preparePayload();
852+
res.preparePayload(req->url().path());
853853

854854
startDeadline();
855855
if (httpType == HttpType::HTTP)

http/http_response.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ struct Response
186186
return response.body().payloadSize();
187187
}
188188

189-
void preparePayload()
189+
void preparePayload(std::string_view s)
190190
{
191191
// This code is a throw-free equivalent to
192192
// beast::http::message::prepare_payload
@@ -209,8 +209,7 @@ struct Response
209209
{
210210
BMCWEB_LOG_CRITICAL("{} Response content provided but code was "
211211
"no-content or not_modified, which aren't "
212-
"allowed to have a body",
213-
logPtr(this));
212+
"allowed to have a body \"{}\"", logPtr(this), s);
214213
response.content_length(0);
215214
return;
216215
}

0 commit comments

Comments
 (0)