Closed mfts closed 3 months ago
Hi, you checked the checkbox indicating you searched issues and find nothing relevant. The most recent issue that was openend before yours, with almost the same title, has your answer: https://github.com/tus/tus-node-server/issues/634 (which in turn was a duplicate of another of the same).
Regarding chunkSize
, you should never set it on the client unless you are forced too. See the warnings in the tus-js-client docs if you're wondering why.
Thanks @Murderlon. I swear I searched the issues but must have forgotten to look in closed issues. My bad.
Regarding
chunkSize
, you should never set it on the client unless you are forced too. See the warnings in the tus-js-client docs if you're wondering why.
Yes, that's a great point. I'm deploying to a serverless infra, therefore my request body size is limited to 4.5 MB hence the chunkSize
in the tus-js-client.
Initial checklist
Steps to reproduce
I'm using @tus/server with next.js pages router.
I set up my api route:
pages/api/file/tus/[[...file]].ts
Everything works well if the file is less than the chunk size I specified in the
tus.Upload
from tus-js-client implementation. However, if that exceeds then @tus/server generates a new URL for subsequent chunk uploads using thegenerateUrl
function. For whatever reason, theproto
value returnshttp
instead ofhttps
. This leads to an insecure URL and my application refuses to execute it, throwing CORS errors.I fixed it by modifying the return statement of
generateUrl
and hardcoding as
afterproto
.Expected behavior
proto should be https not http
Actual behavior
proto is http not https