Unable to get files using nbi

Hi all,

I’m using the latest GenieACS built from source. I’m using the nbi to get a list of files uploaded to GenieACS.

curl -i 'http://localhost:7557/files/'
HTTP/1.1 404 Not Found
GenieACS-Version: 1.2.3+20201222110936
Date: Wed, 23 Dec 2020 08:35:23 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

The rest of the api seems to be working fine though. Any clarifications would be much appreciated.

Best Regards,
Harry

Try:

curl -i 'http://localhost:7557/fs.files/'

Hi Zaid,

I tried out your suggestion, but the issue still persists.

curl -i 'http://localhost:7557/fs.files'
HTTP/1.1 404 Not Found
GenieACS-Version: 1.2.3+20201222110936
Date: Mon, 28 Dec 2020 08:50:09 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

404 Not Found

Regards,
Harry

Hi, I’ve hit the same problem on the latest version. Seems to be a bug, I’ve fixed it by modifying the regex to permit “.” character, in lib/nbi.

-const QUERY_REGEX = /^\/([a-zA-Z0-9_]+)\/?$/;
+const QUERY_REGEX = /^\/([a-zA-Z0-9_\.]+)\/?$/;

Although, it’s kind of an inconsistency … for GET you must use /fs.files/ but PUT&DELETE works with /files/. I’ll reply if I can find a better fix.

not very elegant but it works.

+      if (collectionName === 'files') { collectionName = 'fs.files'; }
       const collection = collections[collectionName];

@lavira is right, this is a bug. Will publish a fix soon.