v0.6.14: расширенная отладка req.clientId (тип, длина)

This commit is contained in:
2026-06-15 11:06:22 +04:00
parent e197b54197
commit a8136a5f0c
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ipwhitelist",
"version": "0.6.13",
"version": "0.6.14",
"description": "IP WhiteList microservice for cloud provider",
"main": "server.js",
"scripts": {
+6 -3
View File
@@ -57,9 +57,12 @@ function resolveContext(req, res, next) {
req.clientId = isImpersonated ? impersonatedCompanyId : (activeClientId || clientId);
if (!req.clientId) return res.status(400).send(
'<h2>Ошибка</h2><p>Не удалось определить W-номер компании.</p>' +
'<p><b>email:</b> ' + email + '</p>' +
'<p><b>clientId:</b> ' + clientId + '</p>' +
'<p><b>activeClientId:</b> ' + activeClientId + '</p>' +
'<p><b>req.clientId:</b> «' + String(req.clientId) + '» (type: ' + typeof req.clientId + ', len: ' + String(req.clientId).length + ')</p>' +
'<p><b>email (local):</b> ' + email + '</p>' +
'<p><b>clientId (local):</b> ' + clientId + '</p>' +
'<p><b>activeClientId (local):</b> ' + activeClientId + '</p>' +
'<p><b>isImpersonated:</b> ' + isImpersonated + '</p>' +
'<p><b>impersonatedCompanyId (local):</b> ' + impersonatedCompanyId + '</p>' +
'<p><b>IMPERSONATION_ORIGINAL env:</b> ' + (process.env.IMPERSONATION_ORIGINAL || 'не задан') + '</p>' +
'<p><b>IMPERSONATION_TARGET env:</b> ' + (process.env.IMPERSONATION_TARGET || 'не задан') + '</p>' +
'<p><b>IMPERSONATION_COMPANY env:</b> ' + (process.env.IMPERSONATION_COMPANY || 'не задан') + '</p>' +