Skip to content

Commit 54a146b

Browse files
authored
Merge pull request #1693 from CastagnaIT/add_headers
[DrmFactory] Always add missing license req headers
2 parents 933a28d + be8d2c3 commit 54a146b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/decrypters/DrmFactory.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "Helpers.h"
1313
#include "clearkey/ClearKeyDecrypter.h"
1414
#include "utils/Base64Utils.h"
15+
#include "utils/StringUtils.h"
1516
#include "utils/log.h"
1617

1718
#if ANDROID
@@ -37,27 +38,26 @@ void FillDrmConfigDefaults(std::string_view keySystem, DRM::Config& cfg)
3738
{
3839
if (!licCfg.isHttpGetRequest)
3940
{
40-
if (licCfg.reqHeaders.empty())
41+
if (!STRING::KeyExists(licCfg.reqHeaders, "Content-Type"))
4142
licCfg.reqHeaders["Content-Type"] = "application/octet-stream";
4243
}
4344
}
4445
else if (keySystem == DRM::KS_PLAYREADY)
4546
{
4647
if (!licCfg.isHttpGetRequest)
4748
{
48-
if (licCfg.reqHeaders.empty())
49-
{
49+
if (!STRING::KeyExists(licCfg.reqHeaders, "Content-Type"))
5050
licCfg.reqHeaders["Content-Type"] = "text/xml";
51+
if (!STRING::KeyExists(licCfg.reqHeaders, "SOAPAction"))
5152
licCfg.reqHeaders["SOAPAction"] =
5253
"http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense";
53-
}
5454
}
5555
}
5656
else if (keySystem == DRM::KS_WISEPLAY)
5757
{
5858
if (!licCfg.isHttpGetRequest)
5959
{
60-
if (licCfg.reqHeaders.empty())
60+
if (!STRING::KeyExists(licCfg.reqHeaders, "Content-Type"))
6161
licCfg.reqHeaders["Content-Type"] = "application/json";
6262
}
6363
}

0 commit comments

Comments
 (0)