Commit fbb76243 by olly Committed by Toni

Clean up DRM post requests

- Explicitly specify HTTP_METHOD_POST (previously this was
  implicit as a result of the body data being non-null)
- Use null when there's no body data (it's converted to
  null inside of the DataSpec constructor anyway)

PiperOrigin-RevId: 256573384
parent 924cfac9
......@@ -111,7 +111,7 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException {
String url =
request.getDefaultUrl() + "&signedRequest=" + Util.fromUtf8Bytes(request.getData());
return executePost(dataSourceFactory, url, Util.EMPTY_BYTE_ARRAY, null);
return executePost(dataSourceFactory, url, /* httpBody= */ null, /* requestProperties= */ null);
}
@Override
......@@ -139,7 +139,7 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
private static byte[] executePost(
HttpDataSource.Factory dataSourceFactory,
String url,
byte[] data,
@Nullable byte[] httpBody,
@Nullable Map<String, String> requestProperties)
throws IOException {
HttpDataSource dataSource = dataSourceFactory.createDataSource();
......@@ -154,7 +154,8 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
DataSpec dataSpec =
new DataSpec(
Uri.parse(url),
data,
DataSpec.HTTP_METHOD_POST,
httpBody,
/* absoluteStreamPosition= */ 0,
/* position= */ 0,
/* length= */ C.LENGTH_UNSET,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment