Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
comment
  • Loading branch information
BrennanConroy committed Sep 11, 2024
commit 4365ba2ff6904ed4107e7447a0dc34d8dbbfc782
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ protected internal bool InitializeFeatures()
catch (Exception ex)
{
Log.RequestParsingError(Logger, ex);
// Synchronously calls Http.Sys and tells it to send an http response
// No one has written to the response yet (haven't even created the response object below)
Server.SendError(_requestId.Value, StatusCodes.Status400BadRequest, authChallenges: null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately obvious that this is a safe place to call SendError. What does it do? Is it synchronous? Does it schedule something? It doesn't depend on anything established by InitializeFeatures?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a synchronous call, only state it needs from InitializeFeature is the request ID which we pass in. Would you like some sort of comment here mentioning it's a synchronous call to native code?

return false;
}
Expand Down