Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
fix #77
Browse files Browse the repository at this point in the history
  • Loading branch information
archywillhe committed Oct 26, 2023
1 parent 1465f64 commit 9177cc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/insomnia/src/common/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { guard } from '../utils/guard';
import { database as db } from './database';
import { generateId } from './misc';
import { importResourcesToProject } from './importResourcesToProject';
import { getAppVersion } from './constants';

export interface ExportedModel extends BaseModel {
_type: string;
Expand Down Expand Up @@ -276,7 +277,7 @@ export const dummyStartingWorkspace = () => {
"method": "GET",
"body": {},
"parameters": [],
"headers": [{ "name": "User-Agent", "value": "insomnia/0.1.3" }],
"headers": [{ "name": "User-Agent", "value": "insomnium/" + getAppVersion() }],
"authentication": {},
"metaSortKey": -(currentUnixTime - oneSec * 3 - 1),
"isPrivate": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/main/network/libcurl-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export const createConfiguredCurlInstance = ({
const { headers, authentication } = req;

const userAgent: RequestHeader | null = headers.find((h: any) => h.name.toLowerCase() === 'user-agent') || null;
const userAgentOrFallback = typeof userAgent?.value === 'string' ? userAgent?.value : 'insomnia/' + version;
const userAgentOrFallback = typeof userAgent?.value === 'string' ? userAgent?.value : 'insomnium/' + version;
curl.setOpt(Curl.option.USERAGENT, userAgentOrFallback);
if (req.suppressUserAgent) {
curl.setOpt(Curl.option.USERAGENT, '');
Expand Down

0 comments on commit 9177cc7

Please sign in to comment.