[Http] Port of @punycode path to support the :flatten option