[Track1] User Agent Can be Override
See original GitHub issueI do a test to try to override the Use-Agent in Track1 JS SDK, and it succeed. The Following is the details: Codes:
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { ComputeManagementClient } = require("@azure/arm-compute");
msRestNodeAuth.interactiveLogin().then((creds: any) => {
const client = new ComputeManagementClient(creds, "eece696d-f03b-47a5-9e4c-157d7ad85b20", {
userAgent: "aaaaaaaaaaaaaaaaaaaaaaaa"
});
client.operations.list().then((result: any) => {
console.log("The result is:");
console.log(result);
});
}).catch((err: any) => {
console.error(err);
});
Requests Header captured by fiddler:
I think the user-agent should only be extended, instead of overrode. Please check it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Network conditions: Override the user agent string
To override the user agent string from Chrome DevTools: Press Command + Shift + P (Mac) or Control + Shift + P (Windows,...
Read more >Override User Agent in Google Analytics (analytics.js)
Hi there,. I try to map my own user agent parameter to the Google Analytics tag (analytics.js). But I cannot get it to...
Read more >Re: Gimp EPS not working in \epsfile - GNU mailing lists - GNU.org
User -agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 ... I can repeat your error, but leave it to others who know...
Read more >how to override user agent CSS - Stack Overflow
From the looks of it, you are trying to apply the list-style-type property to a span-element, according to this selector span.form-error .
Read more >just_audio 0.6.14+1 | Flutter Package - Pub.dev
final player = AudioPlayer( userAgent: 'myradioapp/1.0 (Linux;Android 11) ... Playback will be prepared to start from track1.mp3 initialIndex: 0, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Code complete with PR https://github.com/Azure/autorest.typescript/pull/1033. Will be released tomorrow (06/15)
I have synched up with other SDK owners and confirmed that they are infact appending the user provided user-agent value (prepending in case of Track 2). So, I have to do the same for Track 1 & Track 2 SDK Generators.
For Track 1 SDK Generator, I am planning to use the user-agent value in the following format:
azure-sdk-for-js/<package_name>/<package_version> ms-rest-js/<package_version><platform_info>
. An example User-Agent String will beazure-sdk-for-js/@azure/arm-compute/11.2.0 ms-rest-js/10.0.0 (Ubuntu; Linux x86_64; rv:34.0)
. To this, the user provided value will be appended.[Note: There is already a default user agent in ms-rest-js. But, that has only ms-rest-js/<version>/<platformspecificdata> which is not sufficient. The above format, that I suggested was based on the Python’s recommendation as mentioned here]
For Track 2, the situation is similar to Track 1 in case of
core-http
. Once, I complete the implementation, I will update this issue.