Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to retrieve the value of Host in the header #724

Open
chinawzy opened this issue Feb 20, 2025 · 0 comments
Open

Unable to retrieve the value of Host in the header #724

chinawzy opened this issue Feb 20, 2025 · 0 comments

Comments

@chinawzy
Copy link

[root@vm101 ~]# cat config.json
[
{
"id": "test",
"execute-command": "./test.sh",
"pass-arguments-to-command": [{"source": "entire-headers"}]
}
]
[root@vm101 ~]# cat test.sh
#!/bin/bash
echo $*
[root@vm101 ~]# ./webhook -hooks config.json -verbose -debug
[webhook] 2025/02/20 10:08:27 version 2.8.1 starting
[webhook] 2025/02/20 10:08:27 setting up os signal watcher
[webhook] 2025/02/20 10:08:27 attempting to load hooks from config.json
[webhook] 2025/02/20 10:08:27 found 1 hook(s) in file
[webhook] 2025/02/20 10:08:27 loaded: test
[webhook] 2025/02/20 10:08:27 serving hooks on http://0.0.0.0:9000/hooks/{id}
[webhook] 2025/02/20 10:08:27 os signal watcher ready

[22f54b] GET /hooks/test HTTP/1.1
[22f54b] Host: localhost:9000
[22f54b] Accept: /
[22f54b] User-Agent: curl/7.61.1
[22f54b]
[webhook] 2025/02/20 10:08:39 [22f54b] incoming HTTP GET request from 127.0.0.1:39952
[webhook] 2025/02/20 10:08:39 [22f54b] test got matched
[webhook] 2025/02/20 10:08:39 [22f54b] error parsing body payload due to unsupported content type header:
[webhook] 2025/02/20 10:08:39 [22f54b] test hook triggered successfully
< [22f54b] 0
[webhook] 2025/02/20 10:08:39 [22f54b] 200 | 0 B | 215.378µs | localhost:9000 | GET /hooks/test
[webhook] 2025/02/20 10:08:39 [22f54b] executing ./test.sh (./test.sh) with arguments ["./test.sh" "{"Accept":"/","User-Agent":"curl/7.61.1"}"] and environment [] using as cwd
[webhook] 2025/02/20 10:08:39 [22f54b] command output: {"Accept":"/","User-Agent":"curl/7.61.1"}

[webhook] 2025/02/20 10:08:39 [22f54b] finished handling test

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant