mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +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 {
|
||||
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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue