http
http copied to clipboard
support for appendUserAgent feature in capacitor.config.json (iOS)
Is your feature request related to a problem? Please describe. We want to use the appendUserAgent feature to add some specific information about our app to iOS apps.
Describe the solution you'd like Append the information from the capacitor configuration the user-agent information that is generated by the http plugin. When we don't use the plugin (Android), the information is correctly appended to the user-agent information.
Describe alternatives you've considered Sending it in the body, but then I have to add it to each request
Additional context See capacitor documentation
@ldikmans how were you able to accomplish this in the body? Using HTTP.setHeader('*', 'User-Agent',
${navigator.userAgent} ${ua});
doesn't seem to work.
@ldikmans how were you able to accomplish this in the body? Using
HTTP.setHeader('*', 'User-Agent',
${navigator.userAgent} ${ua});
doesn't seem to work.
I was not planning to put it in the header, I meant just putting it in the body of the request (as data).
it seems that in version 1.3 this is implemented so I guess you can close this enhancement request
We upgraded to 1.4.1 In capacitor config you can append a user agent string. This works fine when not using the http plugin. When using the http plugin, this is ignored.
/**
- String to append to the original user agent of Capacitor Web View.
- This is disregarded if
overrideUserAgent
is used. - @since 1.4.0 */ appendUserAgent?: string;