reject_host

Attribute Macro reject_host 

Source
#[reject_host]
Expand description

Reject requests that have no host header.

This attribute macro ensures the decorated function only executes when the incoming request has a host header present. Requests without a host header will be filtered out.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[reject_host("localhost")]
async fn handle_with_host(ctx: Context) {
    // Function body for requests with host header
}

The macro takes no parameters and should be applied directly to async functions that accept a Context parameter.