INNER CODE UNIT · Python

fix_http_body

autokitteh/autokitteh · runtimes/pythonrt/runner/main.py:123

def fix_http_body(inputs):
    data = inputs.get("data")
    if not isinstance(data, dict):
        return

    body = data.get("body")
    if not isinstance(body, dict):
        return

    payload = body.get("bytes")
    if isinstance(payload, str):
        try:
            body["bytes"] = b64decode(payload)
        except ValueError:
            pass


def abort_with_exception(context, status, err, show_pickle_help=False):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…