Add check of HTTP method to OSSL_HTTP_REQ_CTX_content()

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13898)
This commit is contained in:
Dr. David von Oheimb 2021-01-18 12:05:11 +01:00 committed by Dr. David von Oheimb
parent 85c8b87b82
commit 0a20cc4bc3
1 changed files with 4 additions and 0 deletions

View File

@ -207,6 +207,10 @@ static int OSSL_HTTP_REQ_CTX_content(OSSL_HTTP_REQ_CTX *rctx,
ERR_raise(ERR_LIB_HTTP, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if (rctx->method_GET) {
ERR_raise(ERR_LIB_HTTP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (content_type != NULL
&& BIO_printf(rctx->mem, "Content-Type: %s\r\n", content_type) <= 0)