[ADD] Respect MIME, start bridging leaves/kicks

Wow, this one _wasn't_ pushed at 3AM, Outstanding.
This commit is contained in:
LDA 2024-07-07 17:30:48 +02:00
commit 43b3f8aaf5
8 changed files with 146 additions and 24 deletions

View file

@ -632,7 +632,7 @@ ASSetPL(const ParseeConfig *conf, char *id, HashMap *m)
}
char *
ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
ASUpload(const ParseeConfig *c, Stream *from, unsigned int size, char *mime)
{
char *size_str, *path, *ret, *user;
int i;
@ -640,7 +640,6 @@ ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
HashMap *reply;
if (!c || !from)
{
Log(LOG_INFO, "Obvious upload fail");
return NULL;
}
@ -655,6 +654,10 @@ ASUpload(const ParseeConfig *c, Stream *from, unsigned int size)
{
HttpRequestHeader(ctx, "Content-Length", size_str);
}
if (mime)
{
HttpRequestHeader(ctx, "Content-Type", mime);
}
HttpRequestSendHeaders(ctx);
for (i = 0; i < size; i++)
@ -739,7 +742,7 @@ ASReupload(const ParseeConfig *c, char *from, char **mime)
{
size = strtol(content_len, NULL, 10);
}
ret = ASUpload(c, HttpClientStream(ctx), size);
ret = ASUpload(c, HttpClientStream(ctx), size, mime ? *mime : NULL);
HttpClientContextFree(ctx);
UriFree(uri);