Skip to content
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

[support presigned URL] support http request without HTTP_USER_AGENT_FIELD #164

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 9 additions & 6 deletions source/core_http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,12 +1632,15 @@ HTTPStatus_t HTTPClient_InitializeRequestHeaders( HTTPRequestHeaders_t * pReques

if( returnStatus == HTTPSuccess )
{
/* Write "User-Agent: <Value>". */
returnStatus = addHeader( pRequestHeaders,
HTTP_USER_AGENT_FIELD,
HTTP_USER_AGENT_FIELD_LEN,
HTTP_USER_AGENT_VALUE,
HTTP_USER_AGENT_VALUE_LEN );
if( ( HTTP_REQUEST_NO_USER_AGENT_FLAG & pRequestInfo->reqFlags ) == 0U )
{
/* Write "User-Agent: <Value>". */
returnStatus = addHeader( pRequestHeaders,
HTTP_USER_AGENT_FIELD,
HTTP_USER_AGENT_FIELD_LEN,
HTTP_USER_AGENT_VALUE,
HTTP_USER_AGENT_VALUE_LEN );
}
}

if( returnStatus == HTTPSuccess )
Expand Down
14 changes: 13 additions & 1 deletion source/include/core_http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,19 @@
*
* This flag is valid only for #HTTPRequestInfo_t reqFlags parameter.
*/
#define HTTP_REQUEST_KEEP_ALIVE_FLAG 0x1U
#define HTTP_REQUEST_KEEP_ALIVE_FLAG 0x1U

/**
* @ingroup http_request_flags
* @brief Set this flag to indicate that the request is for a persistent
* connection.
*
tony-josi-aws marked this conversation as resolved.
Show resolved Hide resolved
* Setting this will cause a "Connection: Keep-Alive" to be written to the
* request headers.
*
* This flag is valid only for #HTTPRequestInfo_t reqFlags parameter.
*/
#define HTTP_REQUEST_NO_USER_AGENT_FLAG 0x2U

/**
* @defgroup http_response_flags HTTPResponse_t Flags
Expand Down
Loading