MINOR: http_ext: add rfc7239_field converter
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 30 Dec 2022 15:37:03 +0000 (16:37 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Jan 2023 14:18:59 +0000 (15:18 +0100)
commit6fb58b8c9d53e2d28a3085d6f583fa72d24daaae
treebdcbbcb67d3c692523bfd07d084d670bc44b299d
parent5c6f86f465b79536fc0ceb2a4740fbcbb6dbab71
MINOR: http_ext: add rfc7239_field converter

Adding new http converter: rfc7239_field.

Takes a string representing 7239 forwarded header single value as
input and extracts a single field/parameter from the header according
to user selection.

  Example:
    # extract host field from forwarded header and store it in req.fhost var
    http-request set-var(req.fhost) req.hdr(forwarded),rfc7239_field(host)
    #input: "proto=https;host=\"haproxy.org:80\""
    #  output: "haproxy.org:80"

    # extract for field from forwarded header and store it in req.ffor var
    http-request set-var(req.ffor) req.hdr(forwarded),rfc7239_field(for)
    #input: "proto=https;host=\"haproxy.org:80\";for=\"127.0.0.1:9999\""
    #  output: "127.0.0.1:9999"

Depends on:
  - "MINOR: http_ext: introduce http ext converters"
doc/configuration.txt
src/http_ext.c