Merge branch 'bugfix/http_server_strcasecmp' into 'master'
using case-insensitive compare for getting http header See merge request idf/esp-idf!3155
This commit is contained in:
commit
7e514c11ca
1 changed files with 3 additions and 3 deletions
|
@ -650,7 +650,7 @@ esp_err_t httpd_query_key_value(const char *qry_str, const char *key, char *val,
|
||||||
* Compare lengths first as key from url is not
|
* Compare lengths first as key from url is not
|
||||||
* null terminated (has '=' in the end) */
|
* null terminated (has '=' in the end) */
|
||||||
if ((offset != strlen(key)) ||
|
if ((offset != strlen(key)) ||
|
||||||
(strncmp(qry_ptr, key, offset))) {
|
(strncasecmp(qry_ptr, key, offset))) {
|
||||||
/* Get the name=val string. Multiple name=value pairs
|
/* Get the name=val string. Multiple name=value pairs
|
||||||
* are separated by '&' */
|
* are separated by '&' */
|
||||||
qry_ptr = strchr(val_ptr, '&');
|
qry_ptr = strchr(val_ptr, '&');
|
||||||
|
@ -764,7 +764,7 @@ size_t httpd_req_get_hdr_value_len(httpd_req_t *r, const char *field)
|
||||||
* null terminated (has ':' in the end).
|
* null terminated (has ':' in the end).
|
||||||
*/
|
*/
|
||||||
if ((val_ptr - hdr_ptr != strlen(field)) ||
|
if ((val_ptr - hdr_ptr != strlen(field)) ||
|
||||||
(strncmp(hdr_ptr, field, strlen(field)))) {
|
(strncasecmp(hdr_ptr, field, strlen(field)))) {
|
||||||
hdr_ptr += strlen(hdr_ptr) + strlen("\r\n");
|
hdr_ptr += strlen(hdr_ptr) + strlen("\r\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -810,7 +810,7 @@ esp_err_t httpd_req_get_hdr_value_str(httpd_req_t *r, const char *field, char *v
|
||||||
* null terminated (has ':' in the end).
|
* null terminated (has ':' in the end).
|
||||||
*/
|
*/
|
||||||
if ((val_ptr - hdr_ptr != strlen(field)) ||
|
if ((val_ptr - hdr_ptr != strlen(field)) ||
|
||||||
(strncmp(hdr_ptr, field, strlen(field)))) {
|
(strncasecmp(hdr_ptr, field, strlen(field)))) {
|
||||||
hdr_ptr += strlen(hdr_ptr) + strlen("\r\n");
|
hdr_ptr += strlen(hdr_ptr) + strlen("\r\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue