Skip to content

Commit

Permalink
Merge branch 'FreeRTOS:main' into headers-complete
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi authored Nov 4, 2023
2 parents 7011be2 + 15213f4 commit 9bbcde1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
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.
*
* 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

0 comments on commit 9bbcde1

Please sign in to comment.