Skip to content

Merge Fix LWTrace leaking HTTP request string to HTML page (#7011) (#7014) #7024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions library/cpp/lwtrace/mon/mon_lwtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct TLogQuery {
}
} catch (...) {
ythrow yexception()
<< CurrentExceptionMessage()
<< EncodeHtmlPcdata(CurrentExceptionMessage())
<< " while parsing track log query: "
<< Text;
}
Expand Down Expand Up @@ -1853,7 +1853,7 @@ class TTracesHtmlPrinter {
try {
Os << src->GetStartTime().ToStringUpToSeconds();
} catch (...) {
Os << "error: " << CurrentExceptionMessage();
Os << "error: " << EncodeHtmlPcdata(CurrentExceptionMessage());
}
Os << "</td>"
<< "<td><div class=\"dropdown\">"
Expand Down Expand Up @@ -3821,17 +3821,17 @@ class TLWTraceMonPage : public NMonitoring::IMonPage {
}
} catch (TPageGenBase& gen) {
out.Clear();
out << gen.what();
out << EncodeHtmlPcdata(gen.what());
} catch (...) {
out.Clear();
if (request.GetParams().Get("error") == "text") {
// Text error reply is helpful for ajax requests
out << NMonitoring::HTTPOKTEXT;
out << CurrentExceptionMessage();
out << EncodeHtmlPcdata(CurrentExceptionMessage());
} else {
WWW_HTML(out) {
out << "<h2>Error</h2><pre>"
<< CurrentExceptionMessage()
<< EncodeHtmlPcdata(CurrentExceptionMessage())
<< Endl;
}
}
Expand Down
Loading