Skip to content

Commit 777595c

Browse files
authored
Log warning headers into PS Warning stream. (#957)
1 parent f4bb2db commit 777595c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/Custom/Module.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ private async Task OnResponseCreated(string id, CancellationToken cancellationTo
105105
var response = eventData?.ResponseMessage as HttpResponseMessage;
106106
if (response != null)
107107
{
108+
if (response.Headers.Warning != null)
109+
{
110+
string warningHeader = response.Headers.Warning.ToString();
111+
await signal(Events.Warning, cancellationToken,
112+
() => EventFactory.CreateWarningEvent(warningHeader));
113+
}
108114
// Log request after response since all our request header are set via middleware pipeline.
109115
var request = response?.RequestMessage;
110116
if (request != null)

0 commit comments

Comments
 (0)