Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass request headers to the JS enrichment (close #901) #902

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

stanch
Copy link
Contributor

@stanch stanch commented Jun 24, 2024

Pass a raw list of headers as the third argument (after event and parameters) to the JavaScript enrichment function.

Example usage:

function process(event, params, headers) {
  for (header of headers) {
    const jwt = header.match(/X-JWT:(.+)/i)
    if (jwt) {
      doSomething(jwt[1].trim())
    }
  }
}

Copy link
Contributor

@benjben benjben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@stanch stanch changed the base branch from master to develop June 25, 2024 09:56
@stanch stanch merged commit 1e8b01b into develop Jun 25, 2024
1 check passed
@stanch stanch deleted the js-headers branch June 25, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants