LFS rest interface should ignore GET arguments

This commit is contained in:
Tester23
2023-06-22 05:48:40 +02:00
parent 2966e81599
commit da227f233a

View File

@ -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);