aws / aws-lambda-go

Libraries, samples and tools to help Go developers develop AWS Lambda functions.
Apache License 2.0
3.58k stars 548 forks source link

Add options lambdaurl.WithDetectContentType and lambda.WithContextValue #516

Closed bmoffatt closed 7 months ago

bmoffatt commented 10 months ago

Issue #, if available:

508

Description of changes:

Adds an option to utilize the stblib http.DetectContentType on the first Write to a lambda url response writer. This is done by adding a lambda.WithContextValue as a mechinisim to squirrel arbitrary context values in StartWithOptions wrappers like lambdaurl.Start

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (1dca084) 72.90% compared to head (0ea7933) 72.93%.

Files Patch % Lines
lambda/handler.go 12.50% 6 Missing and 1 partial :warning:
lambdaurl/http_handler.go 94.59% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #516 +/- ## ========================================== + Coverage 72.90% 72.93% +0.03% ========================================== Files 26 26 Lines 1421 1456 +35 ========================================== + Hits 1036 1062 +26 - Misses 314 322 +8 - Partials 71 72 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.