diff options
| author | Frédéric Desbiens <[email protected]> | 2025-09-29 11:23:20 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-29 11:23:20 +0100 |
| commit | b4ec3ca16e9a2a307411debdd3222fe7c22685cb (patch) | |
| tree | 92cc43ffee492ec14e22692e18effb84a39f49bf | |
| parent | 5ebdc4d9a8058c4302b10a9a14bd2d84411d5a6b (diff) | |
| parent | 0df17a775820977787d56991d185782e303fe060 (diff) | |
Merge pull request #313 from mdkf/dev
#312 Handle HTTP code 429
| -rw-r--r-- | addons/web/nx_web_http_client.c | 1 | ||||
| -rw-r--r-- | addons/web/nx_web_http_common.h | 1 | ||||
| -rw-r--r-- | test/regression/web_test/netx_web_status_code_test.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/nx_web_http_client.c b/addons/web/nx_web_http_client.c index 0de34065..021dd41e 100644 --- a/addons/web/nx_web_http_client.c +++ b/addons/web/nx_web_http_client.c @@ -80,6 +80,7 @@ static NX_WEB_HTTP_CLIENT_STATUS_MAP _nx_web_http_client_status_maps[] = {"415", NX_WEB_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA}, {"416", NX_WEB_HTTP_STATUS_CODE_RANGE_NOT_SATISFY}, {"417", NX_WEB_HTTP_STATUS_CODE_EXPECTATION_FAILED}, + {"429", NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS}, {"500", NX_WEB_HTTP_STATUS_CODE_INTERNAL_ERROR}, {"501", NX_WEB_HTTP_STATUS_CODE_NOT_IMPLEMENTED}, {"502", NX_WEB_HTTP_STATUS_CODE_BAD_GATEWAY}, diff --git a/addons/web/nx_web_http_common.h b/addons/web/nx_web_http_common.h index bd299c40..458cb7d4 100644 --- a/addons/web/nx_web_http_common.h +++ b/addons/web/nx_web_http_common.h @@ -178,6 +178,7 @@ extern "C" { #define NX_WEB_HTTP_STATUS_CODE_SERVICE_UNAVAILABLE 0x3003E /* "503 Service Unavailable" */ #define NX_WEB_HTTP_STATUS_CODE_GATEWAY_TIMEOUT 0x3003F /* "504 Gateway Time-out" */ #define NX_WEB_HTTP_STATUS_CODE_VERSION_ERROR 0x30040 /* "505 HTTP Version not supported" */ +#define NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS 0x30041 /* "429 Too Many Requests" */ #define NX_WEB_HTTP_AUTHENTICATION_ERROR NX_WEB_HTTP_STATUS_CODE_UNAUTHORIZED /* HTTP client authentication failed */ /* Define the HTTP Server TCP port number */ diff --git a/test/regression/web_test/netx_web_status_code_test.c b/test/regression/web_test/netx_web_status_code_test.c index 7e7f0533..65410af9 100644 --- a/test/regression/web_test/netx_web_status_code_test.c +++ b/test/regression/web_test/netx_web_status_code_test.c @@ -76,6 +76,7 @@ static NX_WEB_HTTP_CLIENT_STATUS_MAP test_status_maps[] = {"415", NX_WEB_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA}, {"416", NX_WEB_HTTP_STATUS_CODE_RANGE_NOT_SATISFY}, {"417", NX_WEB_HTTP_STATUS_CODE_EXPECTATION_FAILED}, + {"429", NX_WEB_HTTP_STATUS_CODE_TOO_MANY_REQUESTS}, {"500", NX_WEB_HTTP_STATUS_CODE_INTERNAL_ERROR}, {"501", NX_WEB_HTTP_STATUS_CODE_NOT_IMPLEMENTED}, {"502", NX_WEB_HTTP_STATUS_CODE_BAD_GATEWAY}, |
