Skip to content

Commit

Permalink
Pass host field name to riviere to be able to use custom host PROD-43…
Browse files Browse the repository at this point in the history
…442 (#385)

* Use new hostFieldName for riviere

* Use latest riviere

* Fix tests
  • Loading branch information
manoskouvarakis authored Jun 21, 2024
1 parent 188e3d7 commit e9a2aae
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
21 changes: 14 additions & 7 deletions __snapshots__/diamorphosis.test.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when nothing
},
"color": true,
"styles": [],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"healthCheck": {
"kafka": false,
Expand Down Expand Up @@ -326,7 +327,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
"styles": [
"json"
],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"healthCheck": {
"kafka": false,
Expand Down Expand Up @@ -552,7 +554,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
"styles": [
"json"
],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"healthCheck": {
"kafka": false,
Expand Down Expand Up @@ -778,7 +781,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
"styles": [
"json"
],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"healthCheck": {
"kafka": false,
Expand Down Expand Up @@ -931,7 +935,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
"styles": [
"simple"
],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"nodeEnv": "development",
"app": {
Expand Down Expand Up @@ -1283,7 +1288,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
},
"color": true,
"styles": [],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"queue": {
"url": "",
Expand Down Expand Up @@ -1516,7 +1522,8 @@ exports['Diamorphosis Test should set json/console loggingvariables when console
"styles": [
"json"
],
"headersRegex": "(^X-.*)|cf-ray"
"headersRegex": "(^X-.*)|cf-ray",
"hostFieldName": "host"
},
"queue": {
"url": "",
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/initializers/diamorphosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default (config, orkaOptions: Partial<OrkaOptions>) => {
styles: [],
headersRegex: '(^X-.*)|cf-ray',
maxBodyValueChars: undefined,
hostFieldName: 'host',
...config.riviere
};

Expand Down
1 change: 1 addition & 0 deletions src/initializers/riviere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const init = (config, orkaOptions) => {
bodyKeysRegex: config.riviere.bodyKeysRegex && new RegExp(config.riviere.bodyKeysRegex, 'i'),
bodyKeysCallback: config.riviere.bodyKeysCallback,
color: config.riviere.color,
hostFieldName: config.riviere.hostFieldName,
context: (ctx: Koa.Context) => {
return {
visitor: ctx.state.visitor,
Expand Down

0 comments on commit e9a2aae

Please sign in to comment.