Skip to content

Commit

Permalink
fix: Fixed some security bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
CookieGMVN committed Mar 18, 2024
1 parent 09ca1b7 commit 153e1a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
23 changes: 4 additions & 19 deletions dist/utils/Global.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultTesseractConfig = exports.defaultHeaders = exports.generateDeviceId = exports.getTimeNow = void 0;
const moment_1 = __importDefault(require("moment"));
const randomstring_1 = require("randomstring");
/**
* A function that encode the time to the right format.
* @returns The time in right format.
*/
function getTimeNow() {
return (0, moment_1.default)().format("YYYYMMDDHHmmss" + (0, moment_1.default)().millisecond().toString().slice(0, -1));
}
exports.getTimeNow = getTimeNow;
/**
* A function for generating the device ID.
* @returns The device ID generated.
*/
function generateDeviceId() {
return (0, randomstring_1.generate)({ length: 8, charset: "hex" }) + "-mbib-0000-0000-" + getTimeNow();
return "s1rmi184-mbib-0000-0000-" + getTimeNow();
}
exports.generateDeviceId = generateDeviceId;
/**
* A const for default request headers.
*/
exports.defaultHeaders = {
'Cache-Control': 'no-cache',
'Accept': 'application/json, text/plain, */*',
'Authorization': 'Basic RU1CUkVUQUlMV0VCOlNEMjM0ZGZnMzQlI0BGR0AzNHNmc2RmNDU4NDNm',
'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.4.10 (KHTML, like Gecko) Version/8.0.4 Safari/600.4.10",
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"Origin": "https://online.mbbank.com.vn",
"Referer": "https://online.mbbank.com.vn/",
"Content-Type": "application/json; charset=UTF-8",
"Connection": "keep-alive",
"Elastic-Apm-Traceparent": "00-a05b1d8ae659c91d9254ab749abd3e90-e25b5955e860a55e-01",
};
/**
* Recommended Tesseract OCR config.
*/
exports.defaultTesseractConfig = {
lang: "eng",
oem: 1,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mbbank",
"version": "1.3.0",
"version": "1.4.0",
"description": "An promise-based unofficial API wrapper for Vietnam Military Commercial Joint Stock Bank (MBBank, MB)",
"main": "dist/index.js",
"types": "typings/index.d.ts",
Expand Down

0 comments on commit 153e1a3

Please sign in to comment.