429 (too many requests) error status code in http functions

I created http function:

export async function post_test(request) {
    const response = {
        "headers": {
            "Content-Type": "application/json"
        }
    };

    response.body = 'ok';

    return ok(response);
}

It doesn’t work because requests here come from a third-party source, which only specifies Content-Type and Accept when sending the request. Using Postman, I found out that headers are required Host and User-Agent (with this headers response status code 200, otherwise 429). Is it possible to somehow fix this on the side of my site?

How should look like the result? Like…

{
    "headers": {
        "Content-Type": "application/json",
        "Host": "yourhostname.com",
        "User-Agent": "Your User Agent"
    },
    "body": "ok"
}

Maybe you want to try this…

export async function post_test(request) {
    const requiredHeaders = {
        "Host": "yourhostname.com",
        "User-Agent": "Your User Agent"
    };

    const response = {
        "headers": {
            "Content-Type": "application/json",
            ...requiredHeaders
        }
    };

    response.body = 'ok';
    return ok(response);
}

Not sure…

I can’t change the request because it comes from a third party application. but I need to process this request correctly.
The question is how to bypass the WIX limitation of no headers Host and User-Agent in request.

Using —> AXIOS, maybe ???

Thank you. I know about axios. But that won’t help me because it’s a client package. And in this situation I am the server. I can’t get the client to add the headers I need to its request. And I can’t process this request correctly using the http function in wix because of the requirement.

I have the same issue and no any support from wix…