@riocrypto/common-server 1.0.2938 → 1.0.2939
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/services/logger.js +13 -11
- package/package.json +1 -1
package/build/services/logger.js
CHANGED
|
@@ -143,20 +143,22 @@ class LoggerService {
|
|
|
143
143
|
headers[headerKey] = this.maskValue(String(headers[headerKey]));
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
-
//
|
|
146
|
+
// Every cookie value is treated as a credential. An allowlist of names
|
|
147
|
+
// drifted out of date when admin-google-session was added, and the
|
|
148
|
+
// cookie name alone is enough to see which sessions a request carried.
|
|
149
|
+
// Split on the first "=" only, since base64 values may contain padding.
|
|
147
150
|
if (headers.cookie) {
|
|
148
|
-
headers.cookie = headers.cookie
|
|
151
|
+
headers.cookie = String(headers.cookie)
|
|
149
152
|
.split("; ")
|
|
150
153
|
.map((cookie) => {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return
|
|
158
|
-
}
|
|
159
|
-
return cookie;
|
|
154
|
+
const separator = cookie.indexOf("=");
|
|
155
|
+
if (separator === -1)
|
|
156
|
+
return cookie;
|
|
157
|
+
const key = cookie.slice(0, separator);
|
|
158
|
+
const value = cookie.slice(separator + 1);
|
|
159
|
+
if (value === "")
|
|
160
|
+
return cookie;
|
|
161
|
+
return `${key}=${this.maskValue(value, true)}`;
|
|
160
162
|
})
|
|
161
163
|
.join("; ");
|
|
162
164
|
}
|