1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-13 17:18:14 -05:00

Remove default request size limit for direct uploads (#1406)

* Remove default request size limit - direct upload

* Disable size limit for self-hosted attachments
This commit is contained in:
Thomas Rittson 2021-06-25 10:10:24 +10:00 committed by GitHub
parent 61e41190b2
commit ee1223b8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -622,6 +622,7 @@ namespace Bit.Api.Controllers
}
[HttpPost("{id}/attachment/{attachmentId}")]
[DisableRequestSizeLimit]
[DisableFormValueModelBinding]
public async Task PostFileForExistingAttachment(string id, string attachmentId)
{
@ -630,6 +631,11 @@ namespace Bit.Api.Controllers
throw new BadRequestException("Invalid content.");
}
if (!_globalSettings.SelfHosted)
{
throw new BadRequestException("Invalid endpoint for non self-hosted servers.");
}
var userId = _userService.GetProperUserId(User).Value;
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), userId);
var attachments = cipher?.GetAttachments();

View File

@ -249,6 +249,7 @@ namespace Bit.Api.Controllers
}
[HttpPost("{id}/file/{fileId}")]
[DisableRequestSizeLimit]
[DisableFormValueModelBinding]
public async Task PostFileForExistingSend(string id, string fileId)
{