### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Reproducible with https://github.com/localstack/localstack-terraform-samples/tree/master/apigatewayv2-http-referer-header

Describe here https://github.com/localstack/localstack/issues/5833

### Expected Behavior

Use of the `Referer` header should be consistent across method resources.

### How are you starting LocalStack?

With a `docker run` command

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run localstack/localstack

Run the example https://github.com/localstack/localstack-terraform-samples/tree/master/apigatewayv2-http-referer-header


### Environment

```markdown
- OS: 
- LocalStack:
```


### Anything else?

_No response_
run(shell_cmd, outfile=subprocess.PIPE, print_error=False, env_vars=env_vars)
    LOG.debug("Running command as sudo: %s", shell_cmd)
    result = start_thread(run_command, quiet=True) if asynchronous else run_command()
    return result
def env_vars_to_string(env_vars: Dict) -> str:
    return " ".join(f"{k}='{v}'" for k, v in env_vars.items())
if __name__ == "__main__":
    logging.basicConfig()
    start_component(sys.argv[1], int(sys.argv[2]))