Skip to content

Support utf-8 for webhook #7468

@jingyugao

Description

@jingyugao

Issue Summary

When webhook message contains utf-8 chars, the requests.post will cause a traceback.

Steps to Reproduce

  1. Send an webhook alert contains utf-8 chars.
  2. This line code will cause a traceback.
    data=json_dumps(data),

Technical details:

  • Redash Version:latest
  • Browser/OS: linux
  • How did you install Redash: docker image

example code for test

import requests

try:
    resp = requests.post(
        "https://example.com",
        data="你好",
        headers={},
        timeout=5.0,
    )
except Exception as e:
    print(e)

resp = requests.post(
    "https://example.com",
    data="你好".encode("utf-8"),
    headers={},
    timeout=5.0,
)
print(resp.status_code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions