← All compilation units

Flyology.HTTP.Server.Middleware_Request_IDs

Description

Installs bounded request identifiers before application work.

App_Context

type App_Context is limited private;

Call

procedure Call
  (Context : in out App_Context;
   X       : in out Flyology.HTTP.Server.Applications.Exchange;
   Next    : in out Components.Next_Handler)

Request-ID middleware component.

Parameters
Context

Typed application context

X

Borrowed request exchange

Next

Borrowed downstream continuation

Raised exceptions
Constraint_Error

A custom generator returns an empty, oversized, or syntactically unsafe identifier

Components

with package Components is new
  Flyology.HTTP.Server.Middleware (App_Context);

Generate

Generate      : access procedure
  (Context : in out App_Context;
   X       : Flyology.HTTP.Server.Applications.Exchange;
   Value   : out Ada.Strings.Unbounded.Unbounded_String) := null;

Header_Name

Header_Name   : String := "X-Request-ID";

Trust_Inbound

Trust_Inbound : Boolean := False;

Valid

function Valid (Value : String) return Boolean

Report whether Value is a bounded request identifier containing only ASCII letters, digits, dot, underscore, and hyphen.

Parameters
Value

Candidate identifier

Return value

True when Value is safe for a response header