From 338dfc9a8519c4c3e22949cd4d9ff36ad187d97a Mon Sep 17 00:00:00 2001 From: Jack Kavanagh Date: Thu, 31 Aug 2023 10:29:51 +0200 Subject: [PATCH] fallback to insomnia user agent (#6429) * fallback to insomnia user agent * add default user-agent to oauth2 --- packages/insomnia/src/network/o-auth-2/get-token.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/insomnia/src/network/o-auth-2/get-token.ts b/packages/insomnia/src/network/o-auth-2/get-token.ts index 70a7eb1b1..c6fc508cd 100644 --- a/packages/insomnia/src/network/o-auth-2/get-token.ts +++ b/packages/insomnia/src/network/o-auth-2/get-token.ts @@ -2,6 +2,7 @@ import crypto from 'crypto'; import querystring from 'querystring'; import { v4 as uuidv4 } from 'uuid'; +import { version } from '../../../package.json'; import { escapeRegex } from '../../common/misc'; import * as models from '../../models'; import type { OAuth2Token } from '../../models/o-auth-2-token'; @@ -303,6 +304,7 @@ const sendAccessTokenRequest = async (requestId: string, authentication: AuthTyp headers: [ { name: 'Content-Type', value: 'application/x-www-form-urlencoded' }, { name: 'Accept', value: 'application/x-www-form-urlencoded, application/json' }, + { name: 'User-Agent', value: 'insomnia/' + version }, ...headers, ], url: setDefaultProtocol(authentication.accessTokenUrl),