[FIX] Fix use-after-free on DMs

This commit is contained in:
LDA 2024-06-29 14:54:39 +02:00
commit 4bcf1db4ec
3 changed files with 10 additions and 3 deletions

View file

@ -39,7 +39,10 @@ RouteHead(RouteMedia, arr, argp)
HttpResponseHeader(args->ctx, key, val);
}
HttpSendHeaders(args->ctx);
StreamCopy(HttpClientStream(cctx), HttpServerStream(args->ctx));
if (HttpRequestMethodGet(args->ctx) != HTTP_HEAD)
{
StreamCopy(HttpClientStream(cctx), HttpServerStream(args->ctx));
}
HttpClientContextFree(cctx);
Free(server);