Skip to content

Commit b4ec3ca

Browse files
authored
Merge pull request #313 from mdkf/dev
#312 Handle HTTP code 429
2 parents 5ebdc4d + 0df17a7 commit b4ec3ca

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

addons/web/nx_web_http_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ static NX_WEB_HTTP_CLIENT_STATUS_MAP _nx_web_http_client_status_maps[] =
8080
{"415", NX_WEB_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA},
8181
{"416", NX_WEB_HTTP_STATUS_CODE_RANGE_NOT_SATISFY},
8282
{"417", NX_WEB_HTTP_STATUS_CODE_EXPECTATION_FAILED},
83+
{"429", NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS},
8384
{"500", NX_WEB_HTTP_STATUS_CODE_INTERNAL_ERROR},
8485
{"501", NX_WEB_HTTP_STATUS_CODE_NOT_IMPLEMENTED},
8586
{"502", NX_WEB_HTTP_STATUS_CODE_BAD_GATEWAY},

addons/web/nx_web_http_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ extern "C" {
178178
#define NX_WEB_HTTP_STATUS_CODE_SERVICE_UNAVAILABLE 0x3003E /* "503 Service Unavailable" */
179179
#define NX_WEB_HTTP_STATUS_CODE_GATEWAY_TIMEOUT 0x3003F /* "504 Gateway Time-out" */
180180
#define NX_WEB_HTTP_STATUS_CODE_VERSION_ERROR 0x30040 /* "505 HTTP Version not supported" */
181+
#define NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS 0x30041 /* "429 Too Many Requests" */
181182
#define NX_WEB_HTTP_AUTHENTICATION_ERROR NX_WEB_HTTP_STATUS_CODE_UNAUTHORIZED /* HTTP client authentication failed */
182183

183184
/* Define the HTTP Server TCP port number */

test/regression/web_test/netx_web_status_code_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static NX_WEB_HTTP_CLIENT_STATUS_MAP test_status_maps[] =
7676
{"415", NX_WEB_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA},
7777
{"416", NX_WEB_HTTP_STATUS_CODE_RANGE_NOT_SATISFY},
7878
{"417", NX_WEB_HTTP_STATUS_CODE_EXPECTATION_FAILED},
79+
{"429", NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS},
7980
{"500", NX_WEB_HTTP_STATUS_CODE_INTERNAL_ERROR},
8081
{"501", NX_WEB_HTTP_STATUS_CODE_NOT_IMPLEMENTED},
8182
{"502", NX_WEB_HTTP_STATUS_CODE_BAD_GATEWAY},

0 commit comments

Comments
 (0)