mirror of
https://github.com/bitwarden/server.git
synced 2025-04-15 18:18:12 -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:
parent
61e41190b2
commit
ee1223b8d3
@ -622,6 +622,7 @@ namespace Bit.Api.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{id}/attachment/{attachmentId}")]
|
[HttpPost("{id}/attachment/{attachmentId}")]
|
||||||
|
[DisableRequestSizeLimit]
|
||||||
[DisableFormValueModelBinding]
|
[DisableFormValueModelBinding]
|
||||||
public async Task PostFileForExistingAttachment(string id, string attachmentId)
|
public async Task PostFileForExistingAttachment(string id, string attachmentId)
|
||||||
{
|
{
|
||||||
@ -630,6 +631,11 @@ namespace Bit.Api.Controllers
|
|||||||
throw new BadRequestException("Invalid content.");
|
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 userId = _userService.GetProperUserId(User).Value;
|
||||||
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), userId);
|
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), userId);
|
||||||
var attachments = cipher?.GetAttachments();
|
var attachments = cipher?.GetAttachments();
|
||||||
|
@ -249,6 +249,7 @@ namespace Bit.Api.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{id}/file/{fileId}")]
|
[HttpPost("{id}/file/{fileId}")]
|
||||||
|
[DisableRequestSizeLimit]
|
||||||
[DisableFormValueModelBinding]
|
[DisableFormValueModelBinding]
|
||||||
public async Task PostFileForExistingSend(string id, string fileId)
|
public async Task PostFileForExistingSend(string id, string fileId)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user