Skip to content

Commit

Permalink
Fix typo in enum constants: HTTP_CONENT_... -> HTTP_CONTENT_... (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSomeMan authored Feb 9, 2024
1 parent 303451b commit 711611d
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 180 deletions.
24 changes: 12 additions & 12 deletions src/http_server_accept_and_handle_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,28 +272,28 @@ http_get_content_type_str(const http_content_type_e content_type)
const char* p_content_type_str = "application/octet-stream";
switch (content_type)
{
case HTTP_CONENT_TYPE_TEXT_HTML:
case HTTP_CONTENT_TYPE_TEXT_HTML:
p_content_type_str = "text/html";
break;
case HTTP_CONENT_TYPE_TEXT_PLAIN:
case HTTP_CONTENT_TYPE_TEXT_PLAIN:
p_content_type_str = "text/plain";
break;
case HTTP_CONENT_TYPE_TEXT_CSS:
case HTTP_CONTENT_TYPE_TEXT_CSS:
p_content_type_str = "text/css";
break;
case HTTP_CONENT_TYPE_TEXT_JAVASCRIPT:
case HTTP_CONTENT_TYPE_TEXT_JAVASCRIPT:
p_content_type_str = "text/javascript";
break;
case HTTP_CONENT_TYPE_IMAGE_PNG:
case HTTP_CONTENT_TYPE_IMAGE_PNG:
p_content_type_str = "image/png";
break;
case HTTP_CONENT_TYPE_IMAGE_SVG_XML:
case HTTP_CONTENT_TYPE_IMAGE_SVG_XML:
p_content_type_str = "image/svg+xml";
break;
case HTTP_CONENT_TYPE_APPLICATION_JSON:
case HTTP_CONTENT_TYPE_APPLICATION_JSON:
p_content_type_str = "application/json";
break;
case HTTP_CONENT_TYPE_APPLICATION_OCTET_STREAM:
case HTTP_CONTENT_TYPE_APPLICATION_OCTET_STREAM:
p_content_type_str = "application/octet-stream";
break;
}
Expand All @@ -306,10 +306,10 @@ http_get_content_encoding_str(const http_server_resp_t* const p_resp)
const char* p_content_encoding_str = "";
switch (p_resp->content_encoding)
{
case HTTP_CONENT_ENCODING_NONE:
case HTTP_CONTENT_ENCODING_NONE:
p_content_encoding_str = "";
break;
case HTTP_CONENT_ENCODING_GZIP:
case HTTP_CONTENT_ENCODING_GZIP:
p_content_encoding_str = "Content-Encoding: gzip\r\n";
break;
}
Expand Down Expand Up @@ -614,7 +614,7 @@ http_server_netconn_resp_without_content(
"%s",
(printf_uint_t)resp_code,
p_status_msg,
http_get_content_type_str(HTTP_CONENT_TYPE_APPLICATION_JSON),
http_get_content_type_str(HTTP_CONTENT_TYPE_APPLICATION_JSON),
(printf_ulong_t)strlen(p_empty_json),
p_empty_json))
{
Expand Down Expand Up @@ -895,7 +895,7 @@ http_server_netconn_serve_handle_req(
{
LOG_INFO("Extra HTTP-header resp: %s", g_http_server_extra_header_fields.buf);
}
if ((HTTP_CONENT_TYPE_APPLICATION_JSON == resp.content_type)
if ((HTTP_CONTENT_TYPE_APPLICATION_JSON == resp.content_type)
&& ((HTTP_CONTENT_LOCATION_STATIC_MEM == resp.content_location)
|| (HTTP_CONTENT_LOCATION_HEAP == resp.content_location)))
{
Expand Down
24 changes: 12 additions & 12 deletions src/http_server_resp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ http_server_resp_200_json(const char* p_json_content)
const bool flag_no_cache = true;
const bool flag_add_header_date = true;
return http_server_resp_data_in_static_mem(
HTTP_CONENT_TYPE_APPLICATION_JSON,
HTTP_CONTENT_TYPE_APPLICATION_JSON,
NULL,
strlen(p_json_content),
HTTP_CONENT_ENCODING_NONE,
HTTP_CONTENT_ENCODING_NONE,
(const uint8_t*)p_json_content,
flag_no_cache,
flag_add_header_date);
Expand All @@ -38,10 +38,10 @@ http_server_resp_json_in_heap(const http_resp_code_e http_resp_code, const char*
.content_location = HTTP_CONTENT_LOCATION_HEAP,
.flag_no_cache = flag_no_cache,
.flag_add_header_date = flag_add_header_date,
.content_type = HTTP_CONENT_TYPE_APPLICATION_JSON,
.content_type = HTTP_CONTENT_TYPE_APPLICATION_JSON,
.p_content_type_param = NULL,
.content_len = strlen(p_json_content),
.content_encoding = HTTP_CONENT_ENCODING_NONE,
.content_encoding = HTTP_CONTENT_ENCODING_NONE,
.select_location = {
.memory = {
.p_buf = (const uint8_t*)p_json_content,
Expand All @@ -67,10 +67,10 @@ http_server_resp_json_generator(const http_resp_code_e http_resp_code, json_stre
.content_location = HTTP_CONTENT_LOCATION_JSON_GENERATOR,
.flag_no_cache = flag_no_cache,
.flag_add_header_date = flag_add_header_date,
.content_type = HTTP_CONENT_TYPE_APPLICATION_JSON,
.content_type = HTTP_CONTENT_TYPE_APPLICATION_JSON,
.p_content_type_param = NULL,
.content_len = json_stream_gen_calc_size(p_json_gen),
.content_encoding = HTTP_CONENT_ENCODING_NONE,
.content_encoding = HTTP_CONTENT_ENCODING_NONE,
.select_location = {
.json_generator = {
.p_json_gen = p_json_gen,
Expand All @@ -95,10 +95,10 @@ http_server_resp_err(const http_resp_code_e http_resp_code)
.content_location = HTTP_CONTENT_LOCATION_NO_CONTENT,
.flag_no_cache = true,
.flag_add_header_date = true,
.content_type = HTTP_CONENT_TYPE_TEXT_HTML,
.content_type = HTTP_CONTENT_TYPE_TEXT_HTML,
.p_content_type_param = NULL,
.content_len = 0,
.content_encoding = HTTP_CONENT_ENCODING_NONE,
.content_encoding = HTTP_CONTENT_ENCODING_NONE,
.select_location = {
.memory = {
.p_buf = NULL,
Expand All @@ -120,10 +120,10 @@ http_server_resp_err_json_in_static_mem(const http_resp_code_e http_resp_code, c
.content_location = HTTP_CONTENT_LOCATION_STATIC_MEM,
.flag_no_cache = true,
.flag_add_header_date = true,
.content_type = HTTP_CONENT_TYPE_APPLICATION_JSON,
.content_type = HTTP_CONTENT_TYPE_APPLICATION_JSON,
.p_content_type_param = NULL,
.content_len = strlen(p_json_content),
.content_encoding = HTTP_CONENT_ENCODING_NONE,
.content_encoding = HTTP_CONTENT_ENCODING_NONE,
.select_location = {
.memory = {
.p_buf = (const uint8_t*)p_json_content,
Expand All @@ -145,10 +145,10 @@ http_server_resp_err_json_in_heap(const http_resp_code_e http_resp_code, const c
.content_location = HTTP_CONTENT_LOCATION_HEAP,
.flag_no_cache = true,
.flag_add_header_date = true,
.content_type = HTTP_CONENT_TYPE_APPLICATION_JSON,
.content_type = HTTP_CONTENT_TYPE_APPLICATION_JSON,
.p_content_type_param = NULL,
.content_len = strlen(p_json_content),
.content_encoding = HTTP_CONENT_ENCODING_NONE,
.content_encoding = HTTP_CONTENT_ENCODING_NONE,
.select_location = {
.memory = {
.p_buf = (const uint8_t*)p_json_content,
Expand Down
20 changes: 10 additions & 10 deletions src/include/wifi_manager_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,20 +267,20 @@ typedef enum http_resp_code_e

typedef enum http_content_type_e
{
HTTP_CONENT_TYPE_TEXT_HTML,
HTTP_CONENT_TYPE_TEXT_PLAIN,
HTTP_CONENT_TYPE_TEXT_CSS,
HTTP_CONENT_TYPE_TEXT_JAVASCRIPT,
HTTP_CONENT_TYPE_IMAGE_PNG,
HTTP_CONENT_TYPE_IMAGE_SVG_XML,
HTTP_CONENT_TYPE_APPLICATION_JSON,
HTTP_CONENT_TYPE_APPLICATION_OCTET_STREAM,
HTTP_CONTENT_TYPE_TEXT_HTML,
HTTP_CONTENT_TYPE_TEXT_PLAIN,
HTTP_CONTENT_TYPE_TEXT_CSS,
HTTP_CONTENT_TYPE_TEXT_JAVASCRIPT,
HTTP_CONTENT_TYPE_IMAGE_PNG,
HTTP_CONTENT_TYPE_IMAGE_SVG_XML,
HTTP_CONTENT_TYPE_APPLICATION_JSON,
HTTP_CONTENT_TYPE_APPLICATION_OCTET_STREAM,
} http_content_type_e;

typedef enum http_content_encoding_e
{
HTTP_CONENT_ENCODING_NONE,
HTTP_CONENT_ENCODING_GZIP,
HTTP_CONTENT_ENCODING_NONE,
HTTP_CONTENT_ENCODING_GZIP,
} http_content_encoding_e;

typedef enum http_content_location_e
Expand Down
Loading

0 comments on commit 711611d

Please sign in to comment.