Skip to content

Commit 85954e9

Browse files
committed
Change logging levels. Bump i18middleware detector
1 parent 9d59650 commit 85954e9

5 files changed

Lines changed: 20 additions & 32 deletions

File tree

package-lock.json

Lines changed: 13 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/locale/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"i18next-chained-backend": "4.6.2",
3030
"i18next-fs-backend": "2.6.0",
3131
"i18next-http-backend": "3.0.2",
32-
"i18next-http-middleware": "3.6.0",
32+
"i18next-http-middleware": "3.7.4",
3333
"i18next-resources-to-backend": "1.2.1",
3434
"react-i18next": "15.4.0",
3535
"zod": "3.23.8"

packages/locale/src/i18nBackend.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@ const loadPath =
2727

2828
export function initializeI18n() {
2929
if (!i18n.isInitialized && isServerSide()) {
30+
const lngDetector = new MiddlewareLanguageDetector(null, {
31+
order: ["header", "query", "cookie"],
32+
});
3033
i18n
3134
// @ts-ignore https://github.com/i18next/i18next-fs-backend/issues/57
3235
.use(FSBackend)
33-
.use(MiddlewareLanguageDetector) // this line should switch the language to the one the user reports in the Accept-Language header
36+
.use(lngDetector) // this line should switch the language to the one the user reports in the Accept-Language header
3437
.init({
3538
debug: process.env.PROSOPO_LOG_LEVEL === "debug",
3639
fallbackLng: LanguageSchema.enum.en,
3740
supportedLngs: Object.values(Languages),
38-
3941
ns: ["translation"],
4042
backend: {
4143
loadPath,
4244
},
43-
detection: { order: ["header", "query", "cookie"] },
4445
});
4546
i18n.on("loaded", () => {
4647
console.log("i18n backend loaded");

packages/provider/src/api/ja4Middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const getJA4 = async (headers: IncomingHttpHeaders, logger?: Logger) => {
5050

5151
// Check first byte after the initial 5
5252
if (clientHelloBuffer[5] !== 0x01) {
53-
logger.warn("Invalid ClientHello message: First byte is not 0x01");
53+
logger.debug("Invalid ClientHello message: First byte is not 0x01");
5454
return { ja4PlusFingerprint: DEFAULT_JA4 };
5555
}
5656

packages/provider/src/tasks/frictionless/frictionlessTasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class FrictionlessManager extends CaptchaManager {
149149
for (const [keyIndex, key] of decryptKeys.entries()) {
150150
try {
151151
const { baseBotScore: s, timestamp: t } = await getBotScore(token, key);
152-
this.logger.debug({
152+
this.logger.info({
153153
message: "Successfully decrypted score",
154154
key: key ? `${key.slice(0, 5)}...${key.slice(-5)}` : "",
155155
baseBotScore: s,

0 commit comments

Comments
 (0)