mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
924cfac966
commit
fbb76243bd
1 changed files with 4 additions and 3 deletions
|
|
@ -111,7 +111,7 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
||||||
public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException {
|
public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException {
|
||||||
String url =
|
String url =
|
||||||
request.getDefaultUrl() + "&signedRequest=" + Util.fromUtf8Bytes(request.getData());
|
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
|
@Override
|
||||||
|
|
@ -139,7 +139,7 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
||||||
private static byte[] executePost(
|
private static byte[] executePost(
|
||||||
HttpDataSource.Factory dataSourceFactory,
|
HttpDataSource.Factory dataSourceFactory,
|
||||||
String url,
|
String url,
|
||||||
byte[] data,
|
@Nullable byte[] httpBody,
|
||||||
@Nullable Map<String, String> requestProperties)
|
@Nullable Map<String, String> requestProperties)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
HttpDataSource dataSource = dataSourceFactory.createDataSource();
|
HttpDataSource dataSource = dataSourceFactory.createDataSource();
|
||||||
|
|
@ -154,7 +154,8 @@ public final class HttpMediaDrmCallback implements MediaDrmCallback {
|
||||||
DataSpec dataSpec =
|
DataSpec dataSpec =
|
||||||
new DataSpec(
|
new DataSpec(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
data,
|
DataSpec.HTTP_METHOD_POST,
|
||||||
|
httpBody,
|
||||||
/* absoluteStreamPosition= */ 0,
|
/* absoluteStreamPosition= */ 0,
|
||||||
/* position= */ 0,
|
/* position= */ 0,
|
||||||
/* length= */ C.LENGTH_UNSET,
|
/* length= */ C.LENGTH_UNSET,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue