Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/aws/http/response.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions include/aws/lambda-runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
1 change: 1 addition & 0 deletions src/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down