### 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_
return to_str(search_str) in path or to_bytes(search_str) in data_bytes
    if path == "/" and b"QueueName=" in data_bytes:
        return "sqs", config.service_port("sqs")
    if "Action=ConfirmSubscription" in path:
        return "sns", config.service_port("sns")
    if path.startswith("/2015-03-31/functions/"):
        return "lambda", config.service_port("lambda")
    if _in_path_or_payload("Action=AssumeRoleWithWebIdentity"):
        return "sts", config.service_port("sts")
    if _in_path_or_payload("Action=AssumeRoleWithSAML"):
        return "sts", config.service_port("sts")
    if _in_path_or_payload("Action=AssumeRole"):
        return "sts", config.service_port("sts")
    
    if _in_path_or_payload("QueueUrl=") and _in_path_or_payload("Action="):
        return "sqs", config.service_port("sqs")
    if matches_service_action("sqs", action, version=version):
        return "sqs", config.service_port("sqs")
    
    if matches_service_action("sns", action, version=version):
        return "sns", config.service_port("sns")
    
    stripped = path.strip("/")
    if method in ["GET", "HEAD"] and stripped:
        
        return "s3", config.service_port("s3")
    
    if stripped and "/" not in stripped: