Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set auth headers #64

Closed
wants to merge 2 commits into from
Closed

Add ability to set auth headers #64

wants to merge 2 commits into from

Conversation

dcvz
Copy link
Contributor

@dcvz dcvz commented Jun 24, 2019

Sometimes authentication headers are required to access data, this allows you to set authentication headers for tracks. It follows the existing strategy, using an Authorization protocol.

I'm not sure about tests however.. I've tested with a custom setup, but not sure how to best to set it up for tests as we'd have to rely on something being available online?

Welcome feedback @jorgenhenrichsen :)

Copy link
Owner

@jorgenhenrichsen jorgenhenrichsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that you contribute!

The idea behind this is great, but I have another suggestion.
I have searched around for this topic and could not find any official documentation that confirms that the "AVURLAssetHTTPHeaderFieldsKey" is supported, or that an app using it will be approved for submission, and therefore I don't think it should be included here. The guy submitting an answer in this StackOverflow thread also states that this key is a part of a private API, and that he found it in the sources of WebKit.

My suggestion is a way for people to add the options they want by supplying the options-dictionary directly so that they can use this method by their own initiative. This could be through an additional protocol that AudioItems can conform to.

I will create an issue on a feature to include options with an AudioItem, and then either you can implement a solution or I will get around to it soon :)

@dcvz
Copy link
Contributor Author

dcvz commented Jun 27, 2019

I agree with you. As it's an unsafe API we should leave it at the discretion of the developer to choose to pass in this key instead of making it "recommendable" by including it directly into the API.

I'll try to work on the new proposed solution later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants