Skip to content

Commit

Permalink
Add requestHeaders config option and defaults
Browse files Browse the repository at this point in the history
`requestHeaders` is a configurable option now. Default values are based
on the other integrations using Node.js naming conventions for them.
  • Loading branch information
luismiramirez committed Nov 23, 2021
1 parent 6c00cd1 commit aae3470
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
16 changes: 16 additions & 0 deletions packages/nodejs/src/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ describe("Configuration", () => {
ignoreNamespaces: [],
log: "file",
logPath: "/tmp",
requestHeaders: [
"accept",
"accept-charset",
"accept-encoding",
"accept-language",
"cache-control",
"connection",
"content-length",
"path-info",
"range",
"request-method",
"request-uri",
"server-name",
"server-port",
"server-protocol"
],
transactionDebugMode: false
}

Expand Down
6 changes: 5 additions & 1 deletion packages/nodejs/src/cli/diagnose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,9 @@ export class Diagnose {
}

function format_value(value: any) {
return util.inspect(value)
if (typeof value == "object") {
return JSON.stringify(value)
} else {
return util.inspect(value)
}
}
16 changes: 16 additions & 0 deletions packages/nodejs/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ export class Configuration {
ignoreNamespaces: [],
log: "file",
logPath: this._tmpdir(),
requestHeaders: [
"accept",
"accept-charset",
"accept-encoding",
"accept-language",
"cache-control",
"connection",
"content-length",
"path-info",
"range",
"request-method",
"request-uri",
"server-name",
"server-port",
"server-protocol"
],
transactionDebugMode: false
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/nodejs/src/config/configmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const JS_TO_RUBY_MAPPING: { [key: string]: string } = {
log: "log",
logPath: "log_path",
name: "name",
requestHeaders: "request_headers",
revision: "revision",
runningInContainer: "running_in_container",
transactionDebugMode: "transaction_debug_mode",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/diagnose

0 comments on commit aae3470

Please sign in to comment.