Middleware should check that the x-request-id header is set. If there is no value and a generate has been given it will insert missing request id.
use Raxx.RequestID, generate: :generate_request_id, validate: validate_request_id
def generate(_config) do
UUID.uuid4()
end
def validate(request_id) do
{:ok, request_id}
end
If no validate is given then any request id should be assumed valid.
Middleware should check that the
x-request-id
header is set. If there is no value and a generate has been given it will insert missing request id.If no validate is given then any request id should be assumed valid.
See https://github.com/elixir-plug/plug/blob/master/lib/plug/request_id.ex