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

Clean code for default headers #114

Open
MBueschelberger opened this issue May 23, 2023 · 1 comment
Open

Clean code for default headers #114

MBueschelberger opened this issue May 23, 2023 · 1 comment

Comments

@MBueschelberger
Copy link
Contributor

In the BaseServicesStrategy and the OTEServiceClient, the default headers for e.g. the content-type are set while retrieving the headers from the private attributes of the respective class. The code is partially repetetive and needs to be cleaned.
(See here and here)

@CasperWA
Copy link
Contributor

So looking into this and thinking about it, I don't see how we can do it otherwise.
The client (OTEServiceClient) sets the headers in each created strategy from its own headers (at the time of creation), but from there on its impossible for client to have any more control over what headers are used for the specific strategy to do its calls. And I think that's as it should be.
While these calls are indeed sent to the same OTE Service, there may be a desire to not replicate certain headers more than necessary, as well as carrying through headers into transformations or other kind of calls the OTE Service might perform further along?

In either case, it feel "right" to me that there are no "globally set" headers for an instantiated client and its created strategies, but rather than the strategies' headers reflect the headers set in the client at creation.

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