webdav: handle 0 in limitReqBody correctly (#2484)

This commit is contained in:
Stavros Kois
2024-05-17 12:14:54 +03:00
committed by GitHub
parent c1249b372b
commit 081701ef38
3 changed files with 7 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ description: WebDAV is a set of extensions to the HTTP protocol which allows use
annotations:
title: WebDAV
type: application
version: 1.0.24
version: 1.0.25
apiVersion: v2
appVersion: 2.4.59
kubeVersion: '>=1.16.0-0'

View File

@@ -11,6 +11,7 @@ webdavStorage:
description: My second share
hostPath: /mnt/{{.Release.Name }}/share2
readOnly: false
maxRequestBodySizeInGB: 0
fixPermissions: true
- name: share3
enabled: false

View File

@@ -45,7 +45,11 @@ DavLockDB "/usr/local/apache2/var/DavLock"
# Description: {{ .description }}
Alias /{{ .name }} "/{{ include "webdav.shares.prefix" $ }}/{{ .name }}"
<Directory "/{{ include "webdav.shares.prefix" $ }}/{{ .name }}">
LimitRequestBody {{ mul (.maxRequestBodySizeInGB | default 1) $bytesGB }}
{{- $maxReqBody := 1 -}}
{{- if not (kindIs "invalid" .maxRequestBodySizeInGB) -}}
{{- $maxReqBody = mul .maxRequestBodySizeInGB $bytesGB -}}
{{- end }}
LimitRequestBody {{ $maxReqBody }}
</Directory>
{{- if .readOnly }}
<Location "/{{ .name }}">