[web_server] Fix URL collisions with UTF-8 names and sub-devices (#12627)

This commit is contained in:
J. Nick Koston
2026-01-02 13:07:11 -10:00
committed by GitHub
parent 087f521b19
commit c6713eaccb
10 changed files with 413 additions and 119 deletions
+4 -2
View File
@@ -13,7 +13,8 @@ namespace web_server_idf {
static const char *const TAG = "web_server_idf_utils";
void url_decode(char *str) {
size_t url_decode(char *str) {
char *start = str;
char *ptr = str, buf;
for (; *str; str++, ptr++) {
if (*str == '%') {
@@ -31,7 +32,8 @@ void url_decode(char *str) {
*ptr = *str;
}
}
*ptr = *str;
*ptr = '\0';
return ptr - start;
}
bool request_has_header(httpd_req_t *req, const char *name) { return httpd_req_get_hdr_value_len(req, name); }