Skip to content

Should Ptr.t use raw domain names? #408

@samoht

Description

@samoht

Currently, Ptr.t has type [ 'host ] Domain_name.t, but I think that the PTR data is supposed to be domain names. The hostname validation breaks DNS-SD where PTR targets contain spaces:

_hap._tcp.local. PTR My Device._hap._tcp.local.

Cname.t is already [ 'raw ]. Ptr and I suspect we should do the same for PTR:

module Ptr = struct
  type t = [ `raw ] Domain_name.t
  let decode names buf ~off ~len:_ = Name.decode names buf ~off
end

Users can call Domain_name.host explicitly if they need hostname validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions