### 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_
if to_bytes("key=") in data_bytes:
        return True
    if (
        to_bytes("Content-Disposition: form-data") in data_bytes
        and to_bytes('name="key"') in data_bytes
    ):
        return True
    return False
def get_api_from_custom_rules(method, path, data, headers):
    """Determine backend port based on custom rules."""
    
    if ("/%s/" % PATH_USER_REQUEST) in path:
        return "apigateway", config.service_port("apigateway")
    
    if "AWSAccessKeyId=" in path or "Signature=" in path:
        return "s3", config.service_port("s3")
    
    if is_sqs_queue_url(path):
        return "sqs", config.service_port("sqs")
    
    if path.startswith("/shell") or path.startswith("/dynamodb/shell"):
        return "dynamodb", config.service_port("dynamodb")
    data_bytes = to_bytes(data or "")
    version, action = extract_version_and_action(path, data_bytes)
    def _in_path_or_payload(search_str):