avformat/http: Check white and blacklists on redirects

Noticed while fixing the previous

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-01-06 23:30:47 +01:00
committed by Timo Rothenpieler
parent b9227d49ea
commit 23c8123d5b

View File

@@ -242,6 +242,16 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
proxy_path && av_strstart(proxy_path, "http://", NULL);
freeenv_utf8(env_no_proxy);
if (h->protocol_whitelist && av_match_list(proto, h->protocol_whitelist, ',') <= 0) {
av_log(h, AV_LOG_ERROR, "Protocol '%s' not on whitelist '%s'!\n", proto, h->protocol_whitelist);
return AVERROR(EINVAL);
}
if (h->protocol_blacklist && av_match_list(proto, h->protocol_blacklist, ',') > 0) {
av_log(h, AV_LOG_ERROR, "Protocol '%s' on blacklist '%s'!\n", proto, h->protocol_blacklist);
return AVERROR(EINVAL);
}
if (!strcmp(proto, "https")) {
lower_proto = "tls";
use_proxy = 0;