aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_multipart.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-07-10 13:28:26 +0200
committerLoïc Hoguin <[email protected]>2017-07-10 13:28:26 +0200
commit0eb0db3653bd89809acf528a0a3234c2c3cdde22 (patch)
tree7d7aa3f3503e487fb75f8948aab664fadf951882 /src/cow_multipart.erl
parent8210fd3c195cc04e51a50986fceff316be05d155 (diff)
downloadcowlib-0eb0db3653bd89809acf528a0a3234c2c3cdde22.tar.gz
cowlib-0eb0db3653bd89809acf528a0a3234c2c3cdde22.tar.bz2
cowlib-0eb0db3653bd89809acf528a0a3234c2c3cdde22.zip
Add new module cow_base64url
It implements the algorithm found in RFC 7515 Appendix C https://tools.ietf.org/html/rfc7515#appendix-C with an option to switch between with/no padding variants. Relace the cow_multipart:boundary function to use this and fix issues with agents which do not support slashes in the boundary characters.
Diffstat (limited to 'src/cow_multipart.erl')
-rw-r--r--src/cow_multipart.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cow_multipart.erl b/src/cow_multipart.erl
index f573be5..7ccda0d 100644
--- a/src/cow_multipart.erl
+++ b/src/cow_multipart.erl
@@ -424,7 +424,7 @@ horse_parse() ->
-spec boundary() -> binary().
boundary() ->
- base64:encode(crypto:strong_rand_bytes(48)).
+ cow_base64url:encode(crypto:strong_rand_bytes(48), #{padding => false}).
%% @doc Return the first part's head.
%%