diff --git a/include/aws/http/response.h b/include/aws/http/response.h index 6ef0c20..3740c22 100644 --- a/include/aws/http/response.h +++ b/include/aws/http/response.h @@ -38,6 +38,7 @@ class response { inline void set_response_code(aws::http::response_code c); inline void set_content_type(char const* ct); inline std::string const& get_body() const; + inline std::string const& get_content_type() const; private: response_code m_response_code; @@ -139,6 +140,12 @@ inline std::string const& response::get_body() const { return m_body; } + +inline std::string const& response::get_content_type() const +{ + return m_content_type; +} + inline void response::add_header(std::string name, std::string const& value) { std::transform(name.begin(), name.end(), name.begin(), ::tolower); diff --git a/include/aws/lambda-runtime/runtime.h b/include/aws/lambda-runtime/runtime.h index 46b8817..277041b 100644 --- a/include/aws/lambda-runtime/runtime.h +++ b/include/aws/lambda-runtime/runtime.h @@ -56,6 +56,11 @@ struct invocation_request { */ std::string function_arn; + /** + * The Content-type of the current invocation. + */ + std::string content_type; + /** * Function execution deadline counted in milliseconds since the Unix epoch. */ diff --git a/src/runtime.cpp b/src/runtime.cpp index 1013a19..7d7083d 100644 --- a/src/runtime.cpp +++ b/src/runtime.cpp @@ -280,6 +280,7 @@ runtime::next_outcome runtime::get_next() invocation_request req; req.payload = resp.get_body(); req.request_id = std::move(out).get_result(); + req.content_type = resp.get_content_type(); out = resp.get_header(TRACE_ID_HEADER); if (out.is_success()) {