blob: 1cb197c9b83cda626a6fcb6e390d38c30834d506 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.web;
// Most web browsers support up to 64 kiB maximum URL length.
const MAX_URL_LENGTH int32 = 65536;
alias Url = string:MAX_URL_LENGTH;
// There is no defined maximum length for schemes but this is a reasonable upper bound.
const MAX_URL_SCHEME_NAME_LENGTH int32 = 255;
alias UrlSchemeName = string:MAX_URL_SCHEME_NAME_LENGTH;
// RFC 1035 2.3.4 https://tools.ietf.org/html/rfc1035#section-2.3.4
const MAX_HOST_LENGTH int32 = 255;
alias UrlHostName = string:MAX_HOST_LENGTH;
// MAX_URL_SCHEME_NAME_LENGTH + 3 + MAX_HOST_LENGTH.
const MAX_SCHEME_AND_HOST_LENGTH int32 = 513;
alias UrlSchemeAndHostName = string:MAX_SCHEME_AND_HOST_LENGTH;
// Most servers support less than 16 kiB maximum header size. 4k max headers is a reasonable size.
const MAX_HEADERS_COUNT int32 = 4096;
// A maximum of 4k rules is enough for the current usage of these APIs.
const MAX_RULE_COUNT int32 = 4096;