-
Notifications
You must be signed in to change notification settings - Fork 94
make the runtime client's user agent overrideable #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/runtime.cpp
Outdated
{} | ||
|
||
runtime::runtime(std::string const& endpoint, std::string const& user_agent) | ||
: m_user_agent_header("User-Agent: " + user_agent + ""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the last empty string for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing, I did a bad job cleaning up from a previous revision
src/runtime.cpp
Outdated
runtime::runtime(std::string const& endpoint) : runtime(endpoint, "AWS_Lambda_Cpp/" + std::string(get_version())) | ||
{} | ||
|
||
runtime::runtime(std::string const& endpoint, std::string const& user_agent) | ||
: m_user_agent_header("User-Agent: " + user_agent), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think clang-format is complaining about this.
run clang-format, or just paste the following.
runtime::runtime(std::string const& endpoint) : runtime(endpoint, "AWS_Lambda_Cpp/" + std::string(get_version())) {}
runtime::runtime(std::string const& endpoint, std::string const& user_agent)
: m_user_agent_header("User-Agent: " + user_agent), m_endpoints{{endpoint + "/2018-06-01/runtime/init/error",
endpoint + "/2018-06-01/runtime/invocation/next",
endpoint + "/2018-06-01/runtime/invocation/"}},
m_curl_handle(curl_easy_init())
LGTM just fix the formatting, and merge |
Description of changes:
We use aws-lambda-cpp as a building block for other runtimes. This change lets us choose our own custom user agent for internal tracking.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.