Skip to content

Commit 9411a3c

Browse files
committed
Merge branch 'bugfix/openai_authrization_over_limit' into 'main'
Fix openai authorization header over 128 bytes See merge request adf/esp-webrtc-solution!10
2 parents e34494a + 8fb25f9 commit 9411a3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

solutions/openai_demo/main/openai_signaling.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ static int openai_signaling_send_msg(esp_peer_signaling_handle_t h, esp_peer_sig
6767
} else if (msg->type == ESP_PEER_SIGNALING_MSG_SDP) {
6868
printf("Receive local SDP\n");
6969
char content_type[32] = "Content-Type: application/sdp";
70-
char auth[128];
71-
snprintf(auth, 128, "Authorization: Bearer %s", (char *)sig->cfg.extra_cfg);
70+
int len = strlen("Authorization: Bearer ") + strlen((char *)sig->cfg.extra_cfg) + 1;
71+
char auth[len];
72+
snprintf(auth, len, "Authorization: Bearer %s", (char *)sig->cfg.extra_cfg);
7273
char *header[] = {
7374
content_type,
7475
auth,

0 commit comments

Comments
 (0)