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

Returning HTTP status codes #74

Open
smox opened this issue Jan 25, 2023 · 2 comments
Open

Returning HTTP status codes #74

smox opened this issue Jan 25, 2023 · 2 comments

Comments

@smox
Copy link

smox commented Jan 25, 2023

Hello,

I want to send errors back when the parameters are wrong and I think it is not a nice way to send an error back with 200 OK.
Is there a way to set the HTTP status code of the response?

@ncarlier
Copy link
Owner

Hello, the script execution is returned in real time by Webhookd using a streamed HTTP response (Server Sent Event). Because of that, the HTTP code is already sent before the script execution starts. Therefore a problem detected within the script cannot influence the return code.

@johntdyer
Copy link

Thats a shame, I could see real value in a simple tool to run a script / tool and have the exit code of that script determine the http response code to the originating client making the request

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

No branches or pull requests

3 participants