Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c294e0cb
authored
Mar 13, 2020
by
olly
Committed by
Oliver Woodman
Mar 19, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clarify DataSpec.httpRequestHeaders documentation
Issue: #7069 PiperOrigin-RevId: 300738492
parent
3acc85c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletions
library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java
library/common/src/main/java/com/google/android/exoplayer2/upstream/DataSpec.java
View file @
c294e0cb
...
...
@@ -133,6 +133,10 @@ public final class DataSpec {
/**
* Sets the {@link DataSpec#httpRequestHeaders}. The default value is an empty map.
*
* <p>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.
*
* <p>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:
*
* <ul>
* <li>{@code Range}: {@link HttpDataSource} implementations derive the {@code Range} header
* from {@link #position} and {@link #length}.
* <li>{@code Accept-Encoding}: {@link HttpDataSource} implementations derive the {@code
* Accept-Encoding} header based on whether {@link #flags} includes {@link
* #FLAG_ALLOW_GZIP}.
* <li>{@code User-Agent}: {@link HttpDataSource} implementations set the {@code User-Agent}
* header directly.
* <li>Other headers set at the {@link HttpDataSource} layer. I.e., headers set using {@link
* HttpDataSource#setRequestProperty(String, String)}, and using {@link
* HttpDataSource.RequestProperties#set(String, String)} on the default properties obtained
* from {@link HttpDataSource.Factory#getDefaultRequestProperties()}.
* </ul>
*/
public
final
Map
<
String
,
String
>
httpRequestHeaders
;
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment