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
15 changes: 14 additions & 1 deletion src/LaunchDarkly.EventSource/EventSourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,20 @@ private HttpRequestMessage CreateHttpRequestMessage(Uri uri, string lastEventId)
{
foreach (var item in _configuration.RequestHeaders)
{
request.Headers.Add(item.Key, item.Value);
try
{
request.Headers.Add(item.Key, item.Value);
}
catch (FormatException)
{
// Avoid showing the Authorization header value in the exception message
if (item.Key.Equals("Authorization", StringComparison.OrdinalIgnoreCase))
{
throw new FormatException("The Authorization header is invalid.");
}

throw;
}
}
}

Expand Down
Loading