webhook icon indicating copy to clipboard operation
webhook copied to clipboard

I need to parse url for addr:port

Open Jaff opened this issue 8 months ago • 1 comments

I am getting hooks triggered for incoming requests that are not meant for my app. For example,

[webhook] 2023/11/30 23:24:04 [ce731e] incoming HTTP GET request from 10.191.153.189:56428
[webhook] 2023/11/30 23:24:04 [ce731e] isAlive got matched
[webhook] 2023/11/30 23:24:04 [ce731e] error parsing body payload due to unsupported content type header: 
[webhook] 2023/11/30 23:24:04 [ce731e] isAlive hook triggered successfully

I wish to ignore requests that are not incoming on my desired port 40202 How would I configure my trigger?

Jaff avatar Dec 01 '23 00:12 Jaff

The port you see in this log is a remote port from the caller (ephemeral port), not the local port webhook is listening on. You can read more about how TCP/IP works here

Having said that, if you really want to filter on the high port from the caller you can pass that value to your command as an argument using { "source": "request", "name": "remote-addr" }.

adnanh avatar Jan 20 '24 18:01 adnanh