mirror of
https://github.com/bitwarden/server
synced 2025-12-18 01:03:17 +00: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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user