Skip to content

Commit 14018b5

Browse files
committed
Fix mod_http_upload max_file_size
Documentation says the default is not set, which is incorrect, the default was 10MB. This updates the code and clarifies the value in the documentation.
1 parent b3292df commit 14018b5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/modules/mod_http_upload.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Number of random bytes of a token that will be used in a generated URL.
4444
The text representation of the token will be twice as long as the number of bytes, e.g. for the default value the token in the URL will be 64 characters long.
4545

4646
### `modules.mod_http_upload.max_file_size`
47-
* **Syntax:** positive integer
48-
* **Default:** not set - no size limit
49-
* **Example:** `max_file_size = 10485760`
47+
* **Syntax:** positive integer or the string `"infinity"`
48+
* **Default:** `10485760`
49+
* **Example:** `max_file_size = "infinity"`
5050

5151
Maximum file size (in bytes) accepted by the module.
5252

src/http_upload/mod_http_upload.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ config_spec() ->
9898
validate = positive},
9999
<<"token_bytes">> => #option{type = integer,
100100
validate = positive},
101-
<<"max_file_size">> => #option{type = integer,
101+
<<"max_file_size">> => #option{type = int_or_infinity,
102102
validate = positive},
103103
<<"s3">> => s3_spec()
104104
},
@@ -258,7 +258,7 @@ token_bytes(HostType) ->
258258
gen_mod:get_module_opt(HostType, ?MODULE, token_bytes).
259259

260260

261-
-spec max_file_size(mongooseim:host_type()) -> pos_integer() | undefined.
261+
-spec max_file_size(mongooseim:host_type()) -> pos_integer() | infinity.
262262
max_file_size(HostType) ->
263263
gen_mod:get_module_opt(HostType, ?MODULE, max_file_size).
264264

0 commit comments

Comments
 (0)