mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
fallback to insomnia user agent (#6429)
* fallback to insomnia user agent * add default user-agent to oauth2
This commit is contained in:
parent
0ab5809bba
commit
338dfc9a85
@ -2,6 +2,7 @@ import crypto from 'crypto';
|
|||||||
import querystring from 'querystring';
|
import querystring from 'querystring';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
|
import { version } from '../../../package.json';
|
||||||
import { escapeRegex } from '../../common/misc';
|
import { escapeRegex } from '../../common/misc';
|
||||||
import * as models from '../../models';
|
import * as models from '../../models';
|
||||||
import type { OAuth2Token } from '../../models/o-auth-2-token';
|
import type { OAuth2Token } from '../../models/o-auth-2-token';
|
||||||
@ -303,6 +304,7 @@ const sendAccessTokenRequest = async (requestId: string, authentication: AuthTyp
|
|||||||
headers: [
|
headers: [
|
||||||
{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' },
|
{ name: 'Content-Type', value: 'application/x-www-form-urlencoded' },
|
||||||
{ name: 'Accept', value: 'application/x-www-form-urlencoded, application/json' },
|
{ name: 'Accept', value: 'application/x-www-form-urlencoded, application/json' },
|
||||||
|
{ name: 'User-Agent', value: 'insomnia/' + version },
|
||||||
...headers,
|
...headers,
|
||||||
],
|
],
|
||||||
url: setDefaultProtocol(authentication.accessTokenUrl),
|
url: setDefaultProtocol(authentication.accessTokenUrl),
|
||||||
|
Loading…
Reference in New Issue
Block a user