Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/contentstack-import/src/utils/entries-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ export const lookupEntries = function (
let entry = JSON.stringify(data.entry);
uids?.forEach(function (uid: any) {
if (mappedUids.hasOwnProperty(uid)) {
const sanitizedUid = escapeRegExp(uid);
const escapedMappedUid = escapeRegExp(mappedUids[uid]);
const uidRegex = new RegExp(`\\b${sanitizedUid}\\b`, 'img');
let { status } = validateRegex(uidRegex);
if (status === 'safe') {
// Use a static regex for alphanumeric only uids
const uidRegex = /^[a-zA-Z0-9]+$/; // Static regex that matches alphanumeric uids
if (uid.match(uidRegex)) { // Validate against the static regex
Comment on lines +210 to +212
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshithad0703 , pls check with @cs-raj. Both issues we can't fix.

entry = entry.replace(uidRegex, escapedMappedUid);
mapped.push(uid);
} else {
Expand Down
5 changes: 3 additions & 2 deletions packages/contentstack-utilities/src/auth-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import configHandler from './config-handler';
import dotenv from 'dotenv';
import * as ContentstackManagementSDK from '@contentstack/management';
import messageHandler from './message-handler';
const http = require('http');
// const http = require('http');
import https from 'https';
const url = require('url');
import open from 'open';
import {LoggerService} from './logger';
Expand Down Expand Up @@ -119,7 +120,7 @@ class AuthHandler {
async createHTTPServer(): Promise<object> {
return new Promise((resolve, reject) => {
try {
const server = http.createServer((req, res) => {
const server = https.createServer((req, res) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshithad0703 ,We can't use HTTPS in the CLI because the server is hosted on the client side, so it's not possible. Pls check with @cs-raj regarding this.

const reqURL = req.url;
const queryObject = url.parse(reqURL, true).query;
if (queryObject.code) {
Expand Down