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

HttpTileSource: add HttpClient parameter to constructor #223

Open
janusw opened this issue Nov 16, 2023 · 1 comment
Open

HttpTileSource: add HttpClient parameter to constructor #223

janusw opened this issue Nov 16, 2023 · 1 comment

Comments

@janusw
Copy link
Member

janusw commented Nov 16, 2023

Follow-up to #213, #214, #216, #221 ...

The HttpTileSource class should have an optional HttpClient parameter in its constructor.

This parameter should replace the current parameter userAgent and would introduce the possibility to set further header items like a referrer, credentials or an authentication token, so that the methods AddHeader and GetHeaders could be removed.

If no HttpClient parameter is provided, a default HttpClient should be set up that includes no specific header items.

As a side condition, it should not be possible to set a custom HttpClient and a custom tileFetcher at the same time, i.e. there should be two separate constructors, one of which takes an HttpClient parameter, while the other takes a tileFetcher parameter (because using a custom tileFetcher means that the HttpClient will not be used).

@janusw
Copy link
Member Author

janusw commented Nov 16, 2023

If such a breaking change is implemented, one could also take the opportunity to further clean up the HttpClient constructor, as proposed in #216 (comment):

Parameters like 'name', 'persistentCache' and 'attribution' could be removed from the constructor entirely without loss of functionality, because they all can be set via public properties.

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

1 participant