Huginn: WebHooksAgent and Recieved Headers

Created on 5 Dec 2018  路  4Comments  路  Source: huginn/huginn

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?

help wanted

Most helpful comment

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.

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

All 4 comments

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-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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vijayrajah picture vijayrajah  路  5Comments

knu picture knu  路  9Comments

feilongfl picture feilongfl  路  3Comments

TheReal1604 picture TheReal1604  路  4Comments

AnimusAstralis picture AnimusAstralis  路  4Comments