Skip to content

Webhook method is always POST #1615

@nzottmann

Description

@nzottmann

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

The docs mention that the webhook method can be configured: https://crazymax.dev/diun/notif/webhook/

I tried GET, POST and PUT (which I need) but the request method is always POST.

Expected behaviour

The request should use the configured method.

Actual behaviour

The request is always a POST request.

Steps to reproduce

Setup a webhook to an endpoint which shows the called method.

Diun version

4.31.0

Docker info

Client: Docker Engine - Community
 Version:    29.2.1

Docker Compose config

DIUN_NOTIF_WEBHOOK_METHOD=GET

Logs

"webhook": {
      "endpoint": "x",
      "method": "GET",
      "headers": {
        "authorization": "Bearer x",
        "content": ""
      },
      "timeout": 10000000000
    }

Additional info

A quick search in the code showed this line, where POST seems to be hardcoded:

req, err := http.NewRequestWithContext(timeoutCtx, "POST", c.cfg.Endpoint, bytes.NewBuffer(body))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions