Ver Fonte

webdav: handle 0 in limitReqBody correctly (#2484)

Stavros Kois há 1 ano atrás
pai
commit
081701ef38

+ 1 - 1
library/ix-dev/community/webdav/Chart.yaml

@@ -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'

+ 1 - 0
library/ix-dev/community/webdav/ci/https-noauth-values.yaml

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

+ 5 - 1
library/ix-dev/community/webdav/templates/_helper.tpl

@@ -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 }}">