112bb5f3 by Administrator

Merge branch '30852_chatbot_chatgpt' into 'master'

30852_chatbot_chatgpt

See merge request !102
2 parents afc7d324 fd87db87
Showing 1 changed file with 4 additions and 1 deletions
...@@ -66,6 +66,9 @@ const rateLimiter = rateLimit({ ...@@ -66,6 +66,9 @@ const rateLimiter = rateLimit({
66 const app = express() 66 const app = express()
67 const port = 3080 67 const port = 3080
68 68
69 app.set('trust proxy', 1)
70 app.use(express.json())
71 app.use(express.urlencoded({ extended: true }))
69 app.use(bodyParser.json()) 72 app.use(bodyParser.json())
70 app.use(cors()) 73 app.use(cors())
71 app.use(require('morgan')('dev')) 74 app.use(require('morgan')('dev'))
...@@ -403,7 +406,7 @@ async function setChatUsage(params) { ...@@ -403,7 +406,7 @@ async function setChatUsage(params) {
403 406
404 async function validation (aiwp_app_id, req, res) { 407 async function validation (aiwp_app_id, req, res) {
405 const aiwp_logged_in = req.cookies[user_secret_id] ? decodeURIComponent(req.cookies[user_secret_id]) : ""; 408 const aiwp_logged_in = req.cookies[user_secret_id] ? decodeURIComponent(req.cookies[user_secret_id]) : "";
406 const limit = req.cookies["WcvYPABR"] ? parseInt(req.cookies["WcvYPABR"].replace(/\D/g, '')) : 3; 409 const limit = req.cookies["WcvYPABR"] ? parseInt(req.cookies["WcvYPABR"].replace(/\D/g, '')) : -1;
407 let IS_FREE_USER = false; 410 let IS_FREE_USER = false;
408 let TRIED_USAGE = 0; 411 let TRIED_USAGE = 0;
409 412
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!