Improve HTTP support (to better handle params) and redirect /video params

This commit is contained in:
Kamil Trzcinski
2022-09-07 11:15:09 +02:00
parent 5801152b03
commit f08421a796
6 changed files with 68 additions and 37 deletions

View File

@ -71,19 +71,19 @@ void camera_http_option(http_worker_t *worker, FILE *stream)
}
http_method_t http_methods[] = {
{ "GET /snapshot?", http_snapshot },
{ "GET /snapshot.jpg?", http_snapshot },
{ "GET /stream?", http_stream },
{ "GET /?action=snapshot", http_snapshot },
{ "GET /?action=stream", http_stream },
{ "GET /video?", http_detect_video },
{ "GET /video.html?", http_content, "text/html", html_video_html, 0, &html_video_html_len },
{ "GET /video.m3u8?", http_m3u8_video },
{ "GET /video.h264?", http_h264_video },
{ "GET /video.mkv?", http_mkv_video },
{ "GET /video.mp4?", http_mp4_video },
{ "POST /video?", http_webrtc_offer },
{ "GET /option?", camera_http_option },
{ "GET /?", http_content, "text/html", html_index_html, 0, &html_index_html_len },
{ "GET", "/snapshot", http_snapshot },
{ "GET", "/snapshot.jpg", http_snapshot },
{ "GET", "/stream", http_stream },
{ "GET", "/?action=snapshot", http_snapshot },
{ "GET", "/?action=stream", http_stream },
{ "GET", "/video", http_detect_video },
{ "GET", "/video.html", http_content, "text/html", html_video_html, 0, &html_video_html_len },
{ "GET", "/video.m3u8", http_m3u8_video },
{ "GET", "/video.h264", http_h264_video },
{ "GET", "/video.mkv", http_mkv_video },
{ "GET", "/video.mp4", http_mp4_video },
{ "POST", "/video", http_webrtc_offer },
{ "GET", "/option", camera_http_option },
{ "GET", "/", http_content, "text/html", html_index_html, 0, &html_index_html_len },
{ }
};