Explorer

definy.client-ip-version

description
Whether the client connected with IPv4 or IPv6, from the headers Cloudflare adds (ipv4 / ipv6 / unknown). Cf-Connecting-IPv6 has the original IPv6 when Pseudo IPv4 rewrote CF-Connecting-IP. The IP address itself is not returned
type
Fn(headers: List<@http.field>) -> String
expression
fn(headers$0) =>
  match @http.field-get(fields: $0, name: "Cf-Connecting-IPv6") {
    #some(ipv6$1) =>
      match @core.equal(left: $1, right: "") {
        false =>
          "ipv6",
        true =>
          @definy.client-ip-version-of(headers: $0)
      },
    #none(_) =>
      @definy.client-ip-version-of(headers: $0)
  }
visibility
public
definy.client-ip-version (project definy, branch release-time-compare, snapshot JJrRgQW_LZN6tN8CbYr1dN7HosqNTuIWWYx7ACbt1n0)
id: IazuAPd4QwvUan80Vzn9-prEYomjjg7U9FJpVuQrbyU
content hash: PML5lnmSOtf49Q68vTITqwewgwWcy9zsodj31Rj1WCQ