Skip to content

Commit

Permalink
Merge pull request #8 from rnapier/compact-json
Browse files Browse the repository at this point in the history
Encode JWS as compact JSON
  • Loading branch information
zandbelt authored Apr 5, 2022
2 parents 572452a + 09d70c4 commit 715bcbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jwe.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static bool _cjose_jwe_malloc(size_t bytes, bool random, uint8_t **buffer, cjose
static bool _cjose_jwe_build_hdr(cjose_jwe_t *jwe, cjose_err *err)
{
// serialize the header
char *hdr_str = json_dumps(jwe->hdr, JSON_ENCODE_ANY | JSON_PRESERVE_ORDER);
char *hdr_str = json_dumps(jwe->hdr, JSON_ENCODE_ANY | JSON_PRESERVE_ORDER | JSON_COMPACT);
if (NULL == hdr_str)
{
CJOSE_ERROR(err, CJOSE_ERR_NO_MEMORY);
Expand Down
2 changes: 1 addition & 1 deletion src/jws.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static bool _cjose_jws_build_hdr(cjose_jws_t *jws, cjose_header_t *header, cjose
json_incref(jws->hdr);

// base64url encode the header
char *hdr_str = json_dumps(jws->hdr, JSON_ENCODE_ANY | JSON_PRESERVE_ORDER);
char *hdr_str = json_dumps(jws->hdr, JSON_ENCODE_ANY | JSON_PRESERVE_ORDER | JSON_COMPACT);
if (NULL == hdr_str)
{
CJOSE_ERROR(err, CJOSE_ERR_NO_MEMORY);
Expand Down

0 comments on commit 715bcbc

Please sign in to comment.