Skip to content

Commit b83d8fa

Browse files
authored
apply patch add-content-type maintained by other RICs (#212)
1 parent 1896631 commit b83d8fa

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

include/aws/http/response.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class response {
3838
inline void set_response_code(aws::http::response_code c);
3939
inline void set_content_type(char const* ct);
4040
inline std::string const& get_body() const;
41+
inline std::string const& get_content_type() const;
4142

4243
private:
4344
response_code m_response_code;
@@ -139,6 +140,12 @@ inline std::string const& response::get_body() const
139140
{
140141
return m_body;
141142
}
143+
144+
inline std::string const& response::get_content_type() const
145+
{
146+
return m_content_type;
147+
}
148+
142149
inline void response::add_header(std::string name, std::string const& value)
143150
{
144151
std::transform(name.begin(), name.end(), name.begin(), ::tolower);

include/aws/lambda-runtime/runtime.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ struct invocation_request {
5656
*/
5757
std::string function_arn;
5858

59+
/**
60+
* The Content-type of the current invocation.
61+
*/
62+
std::string content_type;
63+
5964
/**
6065
* Function execution deadline counted in milliseconds since the Unix epoch.
6166
*/

src/runtime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ runtime::next_outcome runtime::get_next()
281281
invocation_request req;
282282
req.payload = resp.get_body();
283283
req.request_id = std::move(out).get_result();
284+
req.content_type = resp.get_content_type();
284285

285286
out = resp.get_header(TRACE_ID_HEADER);
286287
if (out.is_success()) {

0 commit comments

Comments
 (0)