summaryrefslogtreecommitdiffstats
path: root/crypto/http/http_client.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-04-28 15:35:13 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-05-02 08:24:02 +0200
commit07982ebe99c74642402c8065bb2479fb8a6ac13d (patch)
tree3fc841a2d3537a42e42a575ae8ec863e44925007 /crypto/http/http_client.c
parent6c49fdde69fac71a0bc48299c126ca2b1f1e36a3 (diff)
http_client.c: check expected content type only if HTTP status code is 200 (OK)
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18204) (cherry picked from commit e3477d3e5ccd971da3d8a90a7d5096b47372d288)
Diffstat (limited to 'crypto/http/http_client.c')
-rw-r--r--crypto/http/http_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c
index 8133a04936..59a3445813 100644
--- a/crypto/http/http_client.c
+++ b/crypto/http/http_client.c
@@ -670,7 +670,7 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx)
rctx->redirection_url = value;
return 0;
}
- if (rctx->expected_ct != NULL
+ if (rctx->state == OHS_HEADERS && rctx->expected_ct != NULL
&& OPENSSL_strcasecmp(key, "Content-Type") == 0) {
if (OPENSSL_strcasecmp(rctx->expected_ct, value) != 0) {
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_UNEXPECTED_CONTENT_TYPE,