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

has_response marks webhook as returning a response. #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davehorner
Copy link
Contributor

@davehorner davehorner commented Oct 7, 2023

maybe not what you want, but figured I'd pass it your way.
This allows you to output the response when has_response is set.

I can add an example in config.

  5   - url: "/flipped"
  4     commands:
  3       - cmd: ["cmd.exe","/c","cat -B somefile.png | sic --flip-vertical"]
  2         stdin: request-body
  1         has_response: true

(using https://crates.io/crates/sic)

it works for static files. it's not using stdin right now; that would require some more thought and extension of the multipart example, i think.

@davehorner
Copy link
Contributor Author

davehorner commented Oct 7, 2023

main...davehorner:webhook-httpd:passthru-example

This includes the passthru which does work for me. it includes other changes...I can clean up to submit if you please. I could see it being a flag in the prior example, but this is a way to convey the idea. interested in understanding

  2 #[tokio::main(flavor = "current_thread")]
  1 async fn main() {
8           if let Err(()) = do_main().await {

and

async fn do_main() -> Result<(), ()> {

is that current_thread piece making it single threaded? why go to unit type on the result and await outside like that.

thanks

@de-vri-es de-vri-es self-assigned this Oct 23, 2023
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