Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Make JavaScriptEncoder optional and Fallback to JavaScriptEncoder.Def…
Browse files Browse the repository at this point in the history
…ault (#918)

* make JavascriptEncoder optional parameter to prevent crash when no encoder is available.
  • Loading branch information
cijothomas authored Jul 8, 2019
1 parent 8753a25 commit 6ac40d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Version 2.8.0-beta1
- [Fix: Add `IJavaScriptSnippet` service interface and update the `IServiceCollection` extension to register it for `JavaScriptSnippet`.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/890)
- [Make JavaScriptEncoder optional and Fallback to JavaScriptEncoder.Default.](https://github.com/microsoft/ApplicationInsights-aspnetcore/pull/918)

## Version 2.7.1
- [Fix - ApplicationInsights StartupFilter should not swallow exceptions from downstream ApplicationBuilder.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/897)

## Version 2.7.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public JavaScriptSnippet(
TelemetryConfiguration telemetryConfiguration,
IOptions<ApplicationInsightsServiceOptions> serviceOptions,
IHttpContextAccessor httpContextAccessor,
JavaScriptEncoder encoder)
JavaScriptEncoder encoder = null)
{
this.telemetryConfiguration = telemetryConfiguration;
this.httpContextAccessor = httpContextAccessor;
this.enableAuthSnippet = serviceOptions.Value.EnableAuthenticationTrackingJavaScript;
this.encoder = encoder;
this.encoder = (encoder == null) ? JavaScriptEncoder.Default : encoder;
}

/// <summary>
Expand Down

0 comments on commit 6ac40d4

Please sign in to comment.