mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[web] enforce size limit on individual files when cloning project (#35211)
* [web] enforce size limit on individual files when cloning project Co-authored-by: Brian Gough <brian.gough@overleaf.com> * [web] improve test coverage * [agents] speed up running frontend tests * [web] gracefully handle project too large error --------- Co-authored-by: Brian Gough <brian.gough@overleaf.com> GitOrigin-RevId: c7b35a3a9688e15a9bb51c61816da82d39e0d29d
This commit is contained in:
committed by
Copybot
co-authored by
Brian Gough
parent
f62bd990d4
commit
84c6a68eae
@@ -492,6 +492,11 @@ async function copyProjectBlob(req, res, next) {
|
||||
)
|
||||
return render.notFound(res)
|
||||
}
|
||||
if (query.sizeLimit > 0 && sourceBlob.getByteLength() > query.sizeLimit) {
|
||||
return res.status(HTTPStatus.REQUEST_ENTITY_TOO_LARGE).json({
|
||||
size: sourceBlob.getByteLength(),
|
||||
})
|
||||
}
|
||||
// Exit early if the blob exists in the target project.
|
||||
// This will also catch global blobs, which always exist.
|
||||
if (targetBlob) {
|
||||
|
||||
Reference in New Issue
Block a user