aboutsummaryrefslogtreecommitdiff
path: root/src/mod_http_upload.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-06-29 11:06:24 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-06-29 11:06:24 +0300
commit66591b1c0d36b5ae83fd195243b9de01dfd4ef17 (patch)
tree77afbf729bf93cd0617db747e4592dedd6c57f04 /src/mod_http_upload.erl
parentHTTP Upload: increase gen_server call timeout (diff)
Improve URLs validation
Diffstat (limited to 'src/mod_http_upload.erl')
-rw-r--r--src/mod_http_upload.erl14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl
index 43a1999e1..65251e056 100644
--- a/src/mod_http_upload.erl
+++ b/src/mod_http_upload.erl
@@ -178,18 +178,14 @@ mod_opt_type(dir_mode) ->
mod_opt_type(docroot) ->
fun iolist_to_binary/1;
mod_opt_type(put_url) ->
- fun(<<"http://", _/binary>> = URL) -> URL;
- (<<"https://", _/binary>> = URL) -> URL
- end;
+ fun misc:try_url/1;
mod_opt_type(get_url) ->
- fun(<<"http://", _/binary>> = URL) -> URL;
- (<<"https://", _/binary>> = URL) -> URL;
- (undefined) -> undefined
+ fun(undefined) -> undefined;
+ (URL) -> misc:try_url(URL)
end;
mod_opt_type(service_url) ->
- fun(<<"http://", _/binary>> = URL) -> URL;
- (<<"https://", _/binary>> = URL) -> URL;
- (undefined) -> undefined
+ fun(undefined) -> undefined;
+ (URL) -> misc:try_url(URL)
end;
mod_opt_type(custom_headers) ->
fun(Headers) ->