From c294e0cb896f5ca293274dd99dea2d9b2a292c56 Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 13 Mar 2020 12:36:19 +0000 Subject: [PATCH] Clarify DataSpec.httpRequestHeaders documentation Issue: #7069 PiperOrigin-RevId: 300738492 --- .../android/exoplayer2/upstream/DataSpec.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java b/library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java index 1fdb5b3cec..cdbf3fee7d 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java @@ -133,6 +133,10 @@ public final class DataSpec { /** * Sets the {@link DataSpec#httpRequestHeaders}. The default value is an empty map. * + *

Note: {@code Range}, {@code Accept-Encoding} and {@code User-Agent} should not be set with + * this method, since they are set directly by {@link HttpDataSource} implementations. See + * {@link DataSpec#httpRequestHeaders} for more details. + * * @param httpRequestHeaders The {@link DataSpec#httpRequestHeaders}. * @return The builder. */ @@ -325,7 +329,27 @@ public final class DataSpec { */ @Nullable public final byte[] httpBody; - /** Immutable map containing the headers to use in HTTP requests. */ + /** + * Additional HTTP headers to use when requesting the data. + * + *

Note: This map is for additional headers specific to the data being requested. It does not + * include headers that are set directly by {@link HttpDataSource} implementations. In particular, + * this means the following headers are not included: + * + *

+ */ public final Map httpRequestHeaders; /**