Skip to content

aws_lambda filter in json mode should use content-type header from json response - #16645

Merged
mattklein123 merged 2 commits into
envoyproxy:mainfrom
jstewmon:fix-16615
May 25, 2021
Merged

mattklein123 merged 2 commits into
envoyproxy:mainfrom
jstewmon:fix-16615

Conversation

@jstewmon

Copy link
Copy Markdown
Contributor

Commit Message: aws_lambda filter in json mode should use content-type header from json response
Additional Description: fixes #16615
Risk Level: Low
Testing: unit tested
Docs Changes: None - the new behavior conforms to the existing docs.
Release Notes: Bug fix mentioned in version history
Platform Specific Features: None
Fixes #16615

@jstewmon

Copy link
Copy Markdown
Contributor Author

@rgs1 would you mind giving this small PR a review?

rgs1
rgs1 previously approved these changes May 25, 2021

@rgs1 rgs1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo some nits – over to @tonya11en for final review & merging. Thanks!

}

/**
* encodeData() data in JSON mode should use respect content-type header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/use//

}

// Use JSON as the default content-type. If the JSON response headers has a
// content-type key, it will override.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If the response headers have a different content-type set, that will be used instead.

@marcomagdy

marcomagdy commented May 25, 2021 •

Copy link
Copy Markdown
Contributor

LGTM as well FWIW :)
Thanks @jstewmon

Comment thread docs/root/version_history/current.rst Outdated
---------
*Changes expected to improve the state of the world and are unlikely to have negative effects*

* aws_lambda: in JSON mode, the downstream response content-type header will now be set from the content-type entry in the JSON response's headers map, if present.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think there's a "JSON mode" per se. It's either normal or passthrough.
So, this should probably read "unless passthrough is on, the downstream response..."

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mattklein123
mattklein123 merged commit bd900d8 into envoyproxy:main May 25, 2021
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-lambda passing wrong content-type when payload_passthrough=false

4 participants