Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Webhook] Allow consumer to change the HTTP response #51837

Open
Labels
@sgehrig

Description

@sgehrig

Description

Due to how the web hook component is setup it's not possible to change the HTTP response for the web hook request from its consumer. It's only possible to provide a custom but "static" response from the web hook request parser.
I know that the general use case for web hooks is to answer with empty200 or202 responses to indicate that the web hook has received the event, but it might be limiting depending on what the web hook caller may support.
We're usingtus/tusd connected to a Symfony backend using the web hook component for example and its web hook implementation allows to react on web hook responses that have a specific format. This is especially important if you want to communicate errors from the web hook call (permission, validation, etc.) throughtusd back to the client.

Sure, we can just drop the web hook component for this use case and use a regular controller, but I might be tempted to think that the general use case of providing custom responses to a web hook caller from within the web hook consumer is probably a more common one.

Would something like that in general be a viable option for the web hook component?

To make it work we'd need to use an optional return value from the\Symfony\Component\RemoteEvent\Consumer\ConsumerInterface::consume method and forward that return value through the message bus back to\Symfony\Component\Webhook\Controller\WebhookController::handle. This will only work for synchronous executions of\Symfony\Component\RemoteEvent\Messenger\ConsumeRemoteEventHandler however. I think this can be done in a BC way and can stay purely optional.

What do you think? If this is worth I try, I can provide a PR.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp