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 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
4 changes: 2 additions & 2 deletions docs/doxygen/include/size_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</tr>
<tr>
<td>core_http_client.c</td>
<td><center>3.1K</center></td>
<td><center>3.2K</center></td>
<td><center>2.5K</center></td>
</tr>
<tr>
Expand All @@ -29,7 +29,7 @@
</tr>
<tr>
<td><b>Total estimates</b></td>
<td><b><center>23.9K</center></b></td>
<td><b><center>24.0K</center></b></td>
<td><b><center>20.7K</center></b></td>
</tr>
</table>
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
13 changes: 12 additions & 1 deletion source/include/core_http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@
*
* 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 skip the User-Agent in the request headers.
*
tony-josi-aws marked this conversation as resolved.
Show resolved Hide resolved
* Setting this will cause the "User-Agent: <Value>" to be omitted in 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