http_server疑问
Posted: Fri Jun 17, 2022 3:07 pm
file_server示例中有一段代码
将favicon_get_handler有关的代码全部删除,且没有注册/favicon_ico这个uri,但是访问服务器时还是会报
这是为什么呢?
Code: Select all
* Handler to respond with an icon file embedded in flash.
* Browsers expect to GET website icon at URI /favicon.ico.
* This can be overridden by uploading file with same name */
static esp_err_t favicon_get_handler(httpd_req_t *req)
{
extern const unsigned char favicon_ico_start[] asm("_binary_favicon_ico_start");
extern const unsigned char favicon_ico_end[] asm("_binary_favicon_ico_end");
const size_t favicon_ico_size = (favicon_ico_end - favicon_ico_start);
httpd_resp_set_type(req, "image/x-icon");
httpd_resp_send(req, (const char *)favicon_ico_start, favicon_ico_size);
return ESP_OK;
}
Code: Select all
W (327372) httpd_uri: httpd_uri: uri handler execution failed
W (327382) httpd_uri: httpd_uri: URI '/favicon.ico' not found