Skip to content

Commit 432097b

Browse files
authored
chore: release v1.3.12 (#72)
1 parent 2c8dfae commit 432097b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

dist/components/proxy-middleware/middlewares/logger_middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class LoggerMiddleware {
7171
const rqLog = {
7272
id: ctx.uuid,
7373
timestamp: Math.floor(Date.now() / 1000),
74-
finalHar: (0, harObectCreator_1.createHar)(ctx.rq.final_request.headers, ctx.rq.final_request.method, protocol, ctx.rq.final_request.host, ctx.rq.final_request.path, ctx.rq.final_request.body, ctx.rq.final_response.status_code, ctx.rq.final_response.body, ctx.rq.final_response.headers || {}, ctx.rq.final_request.query_params),
74+
finalHar: (0, harObectCreator_1.createHar)(ctx.rq.final_request.headers, ctx.rq.final_request.method, protocol, (0, utils_1.getHost)(ctx), ctx.rq.final_request.path, ctx.rq.final_request.body, ctx.rq.final_response.status_code, ctx.rq.final_response.body, ctx.rq.final_response.headers || {}, ctx.rq.final_request.query_params),
7575
requestShellCurl: this.generate_curl_from_har((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.rq) === null || _a === void 0 ? void 0 : _a.final_request) === null || _b === void 0 ? void 0 : _b.requestHarObject), // TODO: Move this to client side
7676
actions: (0, utils_1.get_success_actions_from_action_results)(action_result_objs),
7777
consoleLogs: (_c = ctx === null || ctx === void 0 ? void 0 : ctx.rq) === null || _c === void 0 ? void 0 : _c.consoleLogs,

dist/components/proxy-middleware/rule_action_processor/utils.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export function build_post_process_data(status_code: any, headers: any, body: an
99
body: any;
1010
};
1111
export function get_success_actions_from_action_results(action_result_objs?: any[]): any[];
12+
export function getHost(ctx: any): any;
1213
export function get_file_contents(file_path: any): string;

dist/components/proxy-middleware/rule_action_processor/utils.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.get_file_contents = exports.get_success_actions_from_action_results = exports.build_post_process_data = exports.build_action_processor_response = void 0;
6+
exports.get_file_contents = exports.getHost = exports.get_success_actions_from_action_results = exports.build_post_process_data = exports.build_action_processor_response = void 0;
77
const fs_1 = __importDefault(require("fs"));
88
const build_action_processor_response = (action, success = false, post_process_data = null) => {
99
let resp = {
@@ -35,6 +35,18 @@ const get_success_actions_from_action_results = (action_result_objs = []) => {
3535
return success_action_results_objs.map((obj) => obj.action);
3636
};
3737
exports.get_success_actions_from_action_results = get_success_actions_from_action_results;
38+
const getHost = (ctx) => {
39+
const finalHost = ctx.rq.final_request.host;
40+
const port = ctx.rq.final_request.port;
41+
const protocol = ctx.isSSL ? "https" : "http";
42+
const standardPort = protocol === "https" ? 443 : 80;
43+
// Only append port if it's non-standard and not already in the host
44+
if (port && port !== standardPort && !finalHost.includes(':')) {
45+
return `${finalHost}:${port}`;
46+
}
47+
return finalHost;
48+
};
49+
exports.getHost = getHost;
3850
const get_file_contents = (file_path) => {
3951
return fs_1.default.readFileSync(file_path, "utf-8");
4052
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@requestly/requestly-proxy",
3-
"version": "1.3.11",
3+
"version": "1.3.12",
44
"description": "Proxy that gives superpowers to all the Requestly clients",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)