Wondering if there is any way to get the Headers sent to a WebHooksAgent?
I need to retrieve the headers sent by GitHub to determine what type of event occurred:
X-GitHub-Event:push
X-Hub-Signature: sha1=55b195a83166b43e25a2af01426d96502cd5f680
Looking at the code, it doesn't seem like it (but other agents do get the headers). Any reason why the webhook agent isn't?
I don't think there is a specific reason, having access to the headers would be a great addition.
I modified the existing Webhook Agent to grab headers. Before I open a pull request - I have one question - I didn't want to directly polute the payload body JSON with headers - so I stored them in a hash called X-HUGINN-HEADERS. Is there a standard namespace/convention I should follow?
(https://github.com/Fishwaldo/huginn_webhook2_agent/)
I didn't want to directly polute the payload body JSON with headers - so I stored them in a hash called X-HUGINN-HEADERS. Is there a standard namespace/convention I should follow?
We don't really have a convention, X-HUGINN-HEADERS feels a bit verbose, you could either make it configurable or use headers only if that key isn't already taken by something else.
How are you using header_path, do you want to only return one header?
We don't really have a convention,
X-HUGINN-HEADERSfeels a bit verbose, you could either make it configurable or useheadersonly if that key isn't already taken by something else.
I just picked something that I felt wouldn't conflict with a existing key in some random payload. I've updated it to X-HTTP-HEADERS but made it configurable.
How are you using
header_path, do you want to only return one header?
Yes - In my usecase, i'm only interested in a single header. (The other headers are potentially sensitive. )
I've just created a PR #2434
Most helpful comment
I just picked something that I felt wouldn't conflict with a existing key in some random payload. I've updated it to X-HTTP-HEADERS but made it configurable.
Yes - In my usecase, i'm only interested in a single header. (The other headers are potentially sensitive. )
I've just created a PR #2434