mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-24 12:20:14 +01:00
The markdown link handler was incorrectly extracting file_id and filename
from URLs in the format files/{userId}/{file_id}. The .pop() method was
applied twice in reverse order, causing the userId to be assigned to the
file_id variable and the actual file_id to be used as filename.
This caused downloads to fail with 404 errors as the API was called with
/api/files/download/{userId}/{userId} instead of the correct
/api/files/download/{userId}/{file_id}.
Fixed by directly accessing parts[2] to get the file_id and using the
link text (children) as the filename. Also added children to the useMemo
dependency array to properly track changes.
|
||
|---|---|---|
| .. | ||
| public | ||
| scripts | ||
| src | ||
| test | ||
| babel.config.cjs | ||
| check_updates.sh | ||
| index.html | ||
| jest.config.cjs | ||
| nginx.conf | ||
| package.json | ||
| postcss.config.cjs | ||
| tailwind.config.cjs | ||
| tsconfig.json | ||
| vite.config.ts | ||