aws-lambda-dotnet icon indicating copy to clipboard operation
aws-lambda-dotnet copied to clipboard

fix: removing InternalCustomResponseExceptionHandling in ASP.NET core…

Open MDanialSaleem opened this issue 4 years ago • 1 comments

fix: removing InternalCustomResponseExceptionHandling in ASP.NET core server that resulted in implementation details being leaked.

Issue #, if available: 886

Description of changes: The default behavior of ASP.NET core when an unhandled exception is thrown in a controller is to respond with the type of exception in an HTTP header. This is done by the InternalCustomResponseExceptionHandling method. This leaks implementation details. Per this comment I have removed that behavior.

Prior to this, overriding this behavior required override the ProcessRequest method that called the InternalCustomResponseExceptionHandling method since the latter is private protected. This PR does not change this behavior. One still has to override ProcessRequest in order to change behavior on unhandled exceptions.

[x] I have run the tests and they pass.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

MDanialSaleem avatar Dec 02 '21 13:12 MDanialSaleem

PR https://github.com/aws/aws-lambda-dotnet/pull/899 looks similar and adds opt-in behavior. Should this PR be closed?

ashishdhingra avatar Mar 22 '22 21:03 ashishdhingra

I ended merging the similar https://github.com/aws/aws-lambda-dotnet/pull/899 PR because it allowed users that want the existing behavior to be able to opt in to that behavior. PR 899 was released as part of version 8.0.0 of Amazon.Lamnda.AspNetCoreServer. It was a major version bump due to the slight breaking change behavior.

normj avatar Feb 12 '23 02:02 normj