blob: 672847c07332db1820562607de5919dd0f0c9b0e [file] [log] [blame]
// Copyright (c) 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
#include "net/quic/platform/impl/quic_hostname_utils_impl.h"
namespace quic {
class QUIC_EXPORT_PRIVATE QuicHostnameUtils {
QuicHostnameUtils() = delete;
// Returns true if the sni is valid, false otherwise.
// (1) disallow IP addresses;
// (2) check that the hostname contains valid characters only; and
// (3) contains at least one dot.
static bool IsValidSNI(QuicStringPiece sni);
// Canonicalizes the specified hostname. This involves a wide variety of
// transformations, including lowercasing, removing trailing dots and IDNA
// conversion.
static std::string NormalizeHostname(QuicStringPiece hostname);
} // namespace quic