Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-maiorov-brightsec committed Nov 14, 2023
2 parents 36ec7cf + 9643122 commit 99ea773
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 83 deletions.
49 changes: 33 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brightsec/cli",
"version": "11.2.0",
"version": "11.3.0-next.1",
"private": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,8 +35,9 @@
"better-ajv-errors": "^1.2.0",
"chalk": "^4.1.2",
"ci-info": "^3.8.0",
"content-type": "^1.0.4",
"fast-content-type-parse": "^1.1.0",
"find-up": "^5.0.0",
"iconv-lite": "^0.6.3",
"js-yaml": "^4.1.0",
"ms": "^2.1.3",
"reflect-metadata": "^0.1.13",
Expand All @@ -60,7 +61,6 @@
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/amqplib": "~0.8.2",
"@types/content-type": "^1.1.5",
"@types/har-format": "^1.2.7",
"@types/jest": "^28.1.7",
"@types/js-yaml": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/Archive/Validators/HarValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class HarValidator implements Validator<Har> {
.map(this.parseEntry, this)
.filter((item: string) => !!item);

const targets: string[] = [...new Set(urls).values()];
const targets: string[] = [...new Set(urls)];

return targets.length !== 0;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Handlers/Events/ForwardResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ export class ForwardResponse implements Event {
public readonly protocol?: Protocol;
public readonly headers?: Record<string, string | string[]>;
public readonly body?: string;
public readonly encoding?: 'base64';

constructor(
protocol: Protocol,
body: string,
headers: Record<string, string | string[]>,
statusCode?: number,
errorCode?: string,
message?: string
message?: string,
encoding?: 'base64'
) {
this.protocol = protocol;
this.body = body;
this.headers = headers;
this.status_code = statusCode;
this.error_code = errorCode;
this.message = message;
this.encoding = encoding;
}
}
14 changes: 11 additions & 3 deletions src/Handlers/SendRequestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ export class SendRequestHandler
new Request({ ...event, correlationIdRegex: event.correlation_id_regex })
);

const { statusCode, message, errorCode, body, headers, protocol } =
response;
const {
statusCode,
message,
errorCode,
body,
headers,
protocol,
encoding
} = response;

return new ForwardResponse(
protocol,
body,
headers,
statusCode,
errorCode,
message
message,
encoding
);
}
}
3 changes: 3 additions & 0 deletions src/Repeater/RepeaterServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface RepeaterServerRequestEvent {
headers?: Record<string, string | string[]>;
correlationIdRegex?: string;
body?: string;
encoding?: 'base64';
maxContentSize?: number;
timeout?: number;
}

export type RepeaterServerNetworkTestEvent =
Expand Down
14 changes: 11 additions & 3 deletions src/Repeater/ServerRepeaterLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,24 @@ export class ServerRepeaterLauncher implements RepeaterLauncher {
new Request({ ...event })
);

const { statusCode, message, errorCode, body, headers, protocol } =
response;
const {
statusCode,
message,
errorCode,
body,
headers,
protocol,
encoding
} = response;

return {
protocol,
body,
headers,
statusCode,
errorCode,
message
message,
encoding
};
}
}
Loading

0 comments on commit 99ea773

Please sign in to comment.