mirror of
https://github.com/asapach/peerflix-server.git
synced 2026-04-25 14:45:50 +03:00
[GH-ISSUE #79] Getting a 500 error when sending a POST to /torrents #69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kirpal on GitHub (Jun 16, 2016).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/79
I'm trying to POST a magnet link to localhost:9000/torrents, and keep getting a 500 error. Other endpoints such as POST /torrents/{infoHash}/pause work. Here is the err message:
TypeError: path must be a string at Object.fs.open (fs.js:418:11) at Object.fs.readFile (fs.js:206:6) at readTorrent (/usr/local/lib/node_modules/peerflix-server/node_modules/read-torrent/index.js:54:8) at EventEmitter._.extend.add (/usr/local/lib/node_modules/peerflix-server/server/store.js:36:5) at api.post.file (/usr/local/lib/node_modules/peerflix-server/server/index.js:67:9) at callbacks (/usr/local/lib/node_modules/peerflix-server/node_modules/express/lib/router/index.js:164:37) at param (/usr/local/lib/node_modules/peerflix-server/node_modules/express/lib/router/index.js:138:11) at pass (/usr/local/lib/node_modules/peerflix-server/node_modules/express/lib/router/index.js:145:5) at Router._dispatch (/usr/local/lib/node_modules/peerflix-server/node_modules/express/lib/router/index.js: 173:5) at Object.router (/usr/local/lib/node_modules/peerflix-server/node_modules/express/lib/router/index.js:33: 10) POST /torrents 500 4ms - 956b@asapach commented on GitHub (Jun 16, 2016):
You need to pass the
linkfield in the request as JSON:@Kirpal commented on GitHub (Jun 16, 2016):
This fixed it, thank you.