From 0eb0db3653bd89809acf528a0a3234c2c3cdde22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 10 Jul 2017 13:28:26 +0200 Subject: 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. --- src/cow_multipart.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cow_multipart.erl') 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. %% -- cgit v1.2.3