mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Return null
if MaxFileSizeBytes is 0 (#2409)
* Return "null" if MaxFileSizeBytes is 0 * Add comment and nil check (better save than sorry) * Simplify config
This commit is contained in:
parent
bfa344e831
commit
979a551f1e
5 changed files with 21 additions and 18 deletions
|
@ -36,12 +36,11 @@ func Test_uploadRequest_doUpload(t *testing.T) {
|
|||
}
|
||||
|
||||
maxSize := config.FileSizeBytes(8)
|
||||
unlimitedSize := config.FileSizeBytes(0)
|
||||
logger := log.New().WithField("mediaapi", "test")
|
||||
testdataPath := filepath.Join(wd, "./testdata")
|
||||
|
||||
cfg := &config.MediaAPI{
|
||||
MaxFileSizeBytes: &maxSize,
|
||||
MaxFileSizeBytes: maxSize,
|
||||
BasePath: config.Path(testdataPath),
|
||||
AbsBasePath: config.Path(testdataPath),
|
||||
DynamicThumbnails: false,
|
||||
|
@ -124,7 +123,7 @@ func Test_uploadRequest_doUpload(t *testing.T) {
|
|||
ctx: context.Background(),
|
||||
reqReader: strings.NewReader("test test test"),
|
||||
cfg: &config.MediaAPI{
|
||||
MaxFileSizeBytes: &unlimitedSize,
|
||||
MaxFileSizeBytes: config.FileSizeBytes(0),
|
||||
BasePath: config.Path(testdataPath),
|
||||
AbsBasePath: config.Path(testdataPath),
|
||||
DynamicThumbnails: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue