Attribute Macro referer_filter

Source
#[referer_filter]
Expand description

Filters requests that have a specific referer header.

This attribute macro ensures the decorated function only executes when the incoming request does not have a referer header that matches the specified value. Requests with the matching referer header will be filtered out.

ยงUsage

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

#[referer_filter("http://localhost")]
async fn handle_without_spam_referer(ctx: Context) {
    // Function body for requests not from localhost
}

The macro accepts a string literal specifying the referer value to filter out and should be applied to async functions that accept a Context parameter.