[Backport 2.x] Use BytesRestResponse constructor with contentType in asRestResponse (#3717)#3722
Merged
peternied merged 3 commits intoopensearch-project:2.xfrom Nov 17, 2023
Merged
Conversation
…pensearch-project#3717) Modifies `SecurityResponse.asRestResponse` to use the corresponding constructor for `BytesRestResponse` if the `SecurityResponse` contains the content-type header. This adds a test that fails before the change and demonstrates how using the constructor of BytesRestResponse without content-type defaults to text/plain --------- Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Stephen Crawford <steecraw@amazon.com> Signed-off-by: Craig Perkins <craig5008@gmail.com> Co-authored-by: Stephen Crawford <steecraw@amazon.com> Co-authored-by: Stephen Crawford <65832608+scrawfor99@users.noreply.github.com> (cherry picked from commit b7f47b1)
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #3722 +/- ##
============================================
+ Coverage 64.86% 64.89% +0.03%
- Complexity 3621 3633 +12
============================================
Files 285 285
Lines 20496 20525 +29
Branches 3382 3384 +2
============================================
+ Hits 13294 13319 +25
- Misses 5524 5528 +4
Partials 1678 1678
|
willyborankin
previously approved these changes
Nov 16, 2023
Signed-off-by: Craig Perkins <cwperx@amazon.com>
peternied
approved these changes
Nov 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #3717 to 2.x