Skip to content

Commit 8f49ebc

Browse files
authored
* 403 request error (#37)
roll out fix
1 parent 82274ee commit 8f49ebc

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

1010

11-
## 3.5.0 - 2025-07-22
11+
## 3.4.4 - 2025-07-22
12+
13+
### Fixed
14+
* 403 request error
15+
16+
17+
## 3.4.3 - 2025-07-22
1218

1319
### Changed
1420
* bump dependencies

lib/rest-client.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,20 @@ RestClient.prototype.transfer = function transfer(scan, cb) {
8383

8484
const reqOpts = options.requestOptions || {};
8585
reqOpts.method = 'post';
86-
reqOpts.url = options.fullUrl ? options.fullUrl : `${options.url}/v2/core/scans`;
86+
reqOpts.url = `${options.url}/v2/core/scans`;
8787
if (options.proxy) {
8888
reqOpts.proxy = options.proxy;
8989
}
9090
reqOpts.headers = {
9191
'Content-Type': 'application/json',
9292
'User-Agent': `${pckgJson.name}/${pckgJson.version}`,
93-
'x-api-key': options.apiKey,
94-
'x-apikey': options.apiKey
93+
'x-api-key': options.apiKey
9594
};
95+
if (options.fullUrl) {
96+
reqOpts.url = options.fullUrl;
97+
delete reqOpts.headers['x-api-key'];
98+
reqOpts.headers['x-apikey'] = options.apiKey;
99+
}
96100
reqOpts.json = true;
97101
reqOpts.data = scan;
98102
if (options.branch) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ts-node-client",
33
"description": "npm / node module to transfer dependency information to TrustSource server.",
4-
"version": "3.4.3",
4+
"version": "3.4.4",
55
"homepage": "https://app.trustsource.io/",
66
"author": {
77
"name": "Oleksandr Dmukhovskyi",

0 commit comments

Comments
 (0)