Skip to content

Commit bd45e75

Browse files
committed
Append a "host" attribute to error responses
1 parent 20ed5d5 commit bd45e75

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mongo/db/service_entry_point_common.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
#include "mongo/util/duration.h"
100100
#include "mongo/util/fail_point.h"
101101
#include "mongo/util/scopeguard.h"
102+
#include "mongo/util/net/socket_utils.h"
102103

103104
#include <fmt/format.h>
104105

@@ -214,6 +215,7 @@ void generateErrorResponse(OperationContext* opCtx,
214215
// so we need to reset it to a clean state just to be sure.
215216
replyBuilder->reset();
216217
replyBuilder->setCommandReply(exception.toStatus(), extraFields);
218+
replyBuilder->getBodyBuilder().append("host", getHostNameCachedAndPort());
217219
replyBuilder->getBodyBuilder().appendElements(replyMetadata);
218220
}
219221

0 commit comments

Comments
 (0)