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

Adding Custom Headers to download request (Bearer {{access_token}}) for example #21

Open
pierre-wehbe opened this issue Feb 2, 2021 · 1 comment

Comments

@pierre-wehbe
Copy link

Would be great to customize headers of all requests for images that are behind a secure endpoint

@evgenyneu
Copy link
Owner

evgenyneu commented Feb 6, 2021

@pierre-wehbe that's a great idea, a pull request is always welcome.

We can add headers to MoaSettings and use it like this in an app:

Moa.settings.httpAdditionalHeaders = ["key": "value"]

which can then be added to URLSessionConfiguration.httpAdditionalHeaders in MoaHttpSession. However httpAdditionalHeaders does not accept all headers:

An NSURLSession object is designed to handle various aspects of the HTTP protocol for you. As a result, you should not modify the following headers: Authorization, Connection, Host, Proxy-Authenticate, Proxy-Authorization, WWW-Authenticate

so, if you use those we need a different approach.

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

No branches or pull requests

2 participants