mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-08 08:25:52 +00:00
LFS rest interface should ignore GET arguments
This commit is contained in:
@ -348,6 +348,7 @@ static int http_rest_get_lfs_file(http_request_t* request) {
|
||||
int lfsres;
|
||||
int total = 0;
|
||||
lfs_file_t* file;
|
||||
char *args;
|
||||
|
||||
// don't start LFS just because we're trying to read a file -
|
||||
// it won't exist anyway
|
||||
@ -366,6 +367,12 @@ static int http_rest_get_lfs_file(http_request_t* request) {
|
||||
|
||||
strcpy(fpath, request->url + strlen("api/lfs/"));
|
||||
|
||||
// strip HTTP args with ?
|
||||
args = strchr(fpath, '?');
|
||||
if (args) {
|
||||
*args = 0;
|
||||
}
|
||||
|
||||
ADDLOG_DEBUG(LOG_FEATURE_API, "LFS read of %s", fpath);
|
||||
lfsres = lfs_file_open(&lfs, file, fpath, LFS_O_RDONLY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user