mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
http: Compare case-insensitive URI schemes like as in other places
This commit is contained in:
parent
822de0d038
commit
6e6f07ba59
@ -456,9 +456,9 @@ static int get_port(const char *url, struct http_parser_url *u)
|
||||
if (u->field_data[UF_PORT].len) {
|
||||
return strtol(&url[u->field_data[UF_PORT].off], NULL, 10);
|
||||
} else {
|
||||
if (strncmp(&url[u->field_data[UF_SCHEMA].off], "http", u->field_data[UF_SCHEMA].len) == 0) {
|
||||
if (strncasecmp(&url[u->field_data[UF_SCHEMA].off], "http", u->field_data[UF_SCHEMA].len) == 0) {
|
||||
return 80;
|
||||
} else if (strncmp(&url[u->field_data[UF_SCHEMA].off], "https", u->field_data[UF_SCHEMA].len) == 0) {
|
||||
} else if (strncasecmp(&url[u->field_data[UF_SCHEMA].off], "https", u->field_data[UF_SCHEMA].len) == 0) {
|
||||
return 443;
|
||||
}
|
||||
}
|
||||
|
@ -1171,9 +1171,9 @@ bool esp_http_client_is_chunked_response(esp_http_client_handle_t client)
|
||||
|
||||
esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_handle_t client)
|
||||
{
|
||||
if (!strcmp(client->connection_info.scheme, "https") ) {
|
||||
if (!strcasecmp(client->connection_info.scheme, "https") ) {
|
||||
return HTTP_TRANSPORT_OVER_SSL;
|
||||
} else if (!strcmp(client->connection_info.scheme, "http")) {
|
||||
} else if (!strcasecmp(client->connection_info.scheme, "http")) {
|
||||
return HTTP_TRANSPORT_OVER_TCP;
|
||||
} else {
|
||||
return HTTP_TRANSPORT_UNKNOWN;
|
||||
|
Loading…
Reference in New Issue
Block a user