Skip to content

Commit 0c10b26

Browse files
author
Daniele Briggi
committed
fix(auth): increase auth header size to support jwt
1 parent ac4d295 commit 0c10b26

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wasm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
// MARK: - WASM -
3737

38+
#define AUTH_HEADER_MAXSIZE 4096
39+
3840
char *substr(const char *start, const char *end) {
3941
size_t len = end - start;
4042
char *out = (char *)malloc(len + 1);
@@ -81,7 +83,7 @@ NETWORK_RESULT network_receive_buffer (network_data *data, const char *endpoint,
8183
}
8284

8385
// Authorization
84-
char auth_header[256];
86+
char auth_header[AUTH_HEADER_MAXSIZE];
8587
if (authentication) {
8688
snprintf(auth_header, sizeof(auth_header), "Bearer %s", authentication);
8789
headers[h++] = "Authorization";
@@ -162,7 +164,7 @@ bool network_send_buffer(network_data *data, const char *endpoint, const char *a
162164
int h = 0;
163165
headers[h++] = "Accept";
164166
headers[h++] = "text/plain";
165-
char auth_header[256];
167+
char auth_header[AUTH_HEADER_MAXSIZE];
166168
if (authentication) {
167169
snprintf(auth_header, sizeof(auth_header), "Bearer %s", authentication);
168170
headers[h++] = "Authorization";

0 commit comments

Comments
 (0)