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

Extend user agent only on backend #528

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

danielailie
Copy link
Contributor

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "13.14.0",
"version": "13.14.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be 13.14.2 (the other one has been used).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


headers.setUserAgent(newUserAgent, true);
}

export function isBackend(): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some libraries say like this:

I was afraid that we somehow set the window property, but we don't:

💭

@@ -34,7 +34,9 @@ export class ApiNetworkProvider implements INetworkProvider {
this.config = { ...defaultAxiosConfig, ...config };
this.backingProxyNetworkProvider = new ProxyNetworkProvider(url, proxyConfig);
this.axios = getAxios();
extendUserAgent(this.userAgentPrefix, this.config);
if (isBackend()) {
Copy link
Contributor

@andreibancioiu andreibancioiu Nov 11, 2024

Choose a reason for hiding this comment

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

We can also hide if !isBackend() within extendUserAgent() or extendUserAgentIfAppropriate() 🙃

mradian1
mradian1 previously approved these changes Nov 11, 2024
@danielailie danielailie merged commit 7a1480b into main Nov 11, 2024
4 checks passed
@danielailie danielailie deleted the TOOL-327-extend-user-agent-only-on-backend branch November 11, 2024 11:28
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.

4 participants