github.com/cloudwego/hertz@v0.9.3/pkg/protocol/consts/headers.go (about)

     1  /*
     2   * Copyright 2022 CloudWeGo Authors
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package consts
    18  
    19  const (
    20  	HeaderDate = "Date"
    21  
    22  	HeaderIfModifiedSince = "If-Modified-Since"
    23  	HeaderLastModified    = "Last-Modified"
    24  
    25  	// Redirects
    26  	HeaderLocation = "Location"
    27  
    28  	// Transfer coding
    29  	HeaderTE               = "TE"
    30  	HeaderTrailer          = "Trailer"
    31  	HeaderTrailerLower     = "trailer"
    32  	HeaderTransferEncoding = "Transfer-Encoding"
    33  
    34  	// Controls
    35  	HeaderCookie         = "Cookie"
    36  	HeaderExpect         = "Expect"
    37  	HeaderMaxForwards    = "Max-Forwards"
    38  	HeaderSetCookie      = "Set-Cookie"
    39  	HeaderSetCookieLower = "set-cookie"
    40  
    41  	// Connection management
    42  	HeaderConnection      = "Connection"
    43  	HeaderKeepAlive       = "Keep-Alive"
    44  	HeaderProxyConnection = "Proxy-Connection"
    45  
    46  	// Authentication
    47  	HeaderAuthorization      = "Authorization"
    48  	HeaderProxyAuthenticate  = "Proxy-Authenticate"
    49  	HeaderProxyAuthorization = "Proxy-Authorization"
    50  	HeaderWWWAuthenticate    = "WWW-Authenticate"
    51  
    52  	// Range requests
    53  	HeaderAcceptRanges = "Accept-Ranges"
    54  	HeaderContentRange = "Content-Range"
    55  	HeaderIfRange      = "If-Range"
    56  	HeaderRange        = "Range"
    57  
    58  	// Response context
    59  	HeaderAllow       = "Allow"
    60  	HeaderServer      = "Server"
    61  	HeaderServerLower = "server"
    62  
    63  	// Request context
    64  	HeaderFrom           = "From"
    65  	HeaderHost           = "Host"
    66  	HeaderReferer        = "Referer"
    67  	HeaderReferrerPolicy = "Referrer-Policy"
    68  	HeaderUserAgent      = "User-Agent"
    69  
    70  	// Message body information
    71  	HeaderContentEncoding = "Content-Encoding"
    72  	HeaderContentLanguage = "Content-Language"
    73  	HeaderContentLength   = "Content-Length"
    74  	HeaderContentLocation = "Content-Location"
    75  	HeaderContentType     = "Content-Type"
    76  
    77  	// Content negotiation
    78  	HeaderAccept         = "Accept"
    79  	HeaderAcceptCharset  = "Accept-Charset"
    80  	HeaderAcceptEncoding = "Accept-Encoding"
    81  	HeaderAcceptLanguage = "Accept-Language"
    82  	HeaderAltSvc         = "Alt-Svc"
    83  
    84  	// Protocol
    85  	HTTP11 = "HTTP/1.1"
    86  	HTTP10 = "HTTP/1.0"
    87  	HTTP20 = "HTTP/2.0"
    88  
    89  	// MIME text
    90  	MIMETextPlain             = "text/plain"
    91  	MIMETextPlainUTF8         = "text/plain; charset=utf-8"
    92  	MIMETextPlainISO88591     = "text/plain; charset=iso-8859-1"
    93  	MIMETextPlainFormatFlowed = "text/plain; format=flowed"
    94  	MIMETextPlainDelSpaceYes  = "text/plain; delsp=yes"
    95  	MiMETextPlainDelSpaceNo   = "text/plain; delsp=no"
    96  	MIMETextHtml              = "text/html"
    97  	MIMETextCss               = "text/css"
    98  	MIMETextJavascript        = "text/javascript"
    99  	MIMEMultipartPOSTForm     = "multipart/form-data"
   100  
   101  	// MIME application
   102  	MIMEApplicationOctetStream  = "application/octet-stream"
   103  	MIMEApplicationFlash        = "application/x-shockwave-flash"
   104  	MIMEApplicationHTMLForm     = "application/x-www-form-urlencoded"
   105  	MIMEApplicationHTMLFormUTF8 = "application/x-www-form-urlencoded; charset=UTF-8"
   106  	MIMEApplicationTar          = "application/x-tar"
   107  	MIMEApplicationGZip         = "application/gzip"
   108  	MIMEApplicationXGZip        = "application/x-gzip"
   109  	MIMEApplicationBZip2        = "application/bzip2"
   110  	MIMEApplicationXBZip2       = "application/x-bzip2"
   111  	MIMEApplicationShell        = "application/x-sh"
   112  	MIMEApplicationDownload     = "application/x-msdownload"
   113  	MIMEApplicationJSON         = "application/json"
   114  	MIMEApplicationJSONUTF8     = "application/json; charset=utf-8"
   115  	MIMEApplicationXML          = "application/xml"
   116  	MIMEApplicationXMLUTF8      = "application/xml; charset=utf-8"
   117  	MIMEApplicationZip          = "application/zip"
   118  	MIMEApplicationPdf          = "application/pdf"
   119  	MIMEApplicationWord         = "application/msword"
   120  	MIMEApplicationExcel        = "application/vnd.ms-excel"
   121  	MIMEApplicationPPT          = "application/vnd.ms-powerpoint"
   122  	MIMEApplicationOpenXMLWord  = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
   123  	MIMEApplicationOpenXMLExcel = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
   124  	MIMEApplicationOpenXMLPPT   = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
   125  	MIMEPROTOBUF                = "application/x-protobuf"
   126  
   127  	// MIME image
   128  	MIMEImageJPEG         = "image/jpeg"
   129  	MIMEImagePNG          = "image/png"
   130  	MIMEImageGIF          = "image/gif"
   131  	MIMEImageBitmap       = "image/bmp"
   132  	MIMEImageWebP         = "image/webp"
   133  	MIMEImageIco          = "image/x-icon"
   134  	MIMEImageMicrosoftICO = "image/vnd.microsoft.icon"
   135  	MIMEImageTIFF         = "image/tiff"
   136  	MIMEImageSVG          = "image/svg+xml"
   137  	MIMEImagePhotoshop    = "image/vnd.adobe.photoshop"
   138  
   139  	// MIME audio
   140  	MIMEAudioBasic     = "audio/basic"
   141  	MIMEAudioL24       = "audio/L24"
   142  	MIMEAudioMP3       = "audio/mp3"
   143  	MIMEAudioMP4       = "audio/mp4"
   144  	MIMEAudioMPEG      = "audio/mpeg"
   145  	MIMEAudioOggVorbis = "audio/ogg"
   146  	MIMEAudioWAVE      = "audio/vnd.wave"
   147  	MIMEAudioWebM      = "audio/webm"
   148  	MIMEAudioAAC       = "audio/x-aac"
   149  	MIMEAudioAIFF      = "audio/x-aiff"
   150  	MIMEAudioMIDI      = "audio/x-midi"
   151  	MIMEAudioM3U       = "audio/x-mpegurl"
   152  	MIMEAudioRealAudio = "audio/x-pn-realaudio"
   153  
   154  	// MIME video
   155  	MIMEVideoMPEG          = "video/mpeg"
   156  	MIMEVideoOgg           = "video/ogg"
   157  	MIMEVideoMP4           = "video/mp4"
   158  	MIMEVideoQuickTime     = "video/quicktime"
   159  	MIMEVideoWinMediaVideo = "video/x-ms-wmv"
   160  	MIMEVideWebM           = "video/webm"
   161  	MIMEVideoFlashVideo    = "video/x-flv"
   162  	MIMEVideo3GPP          = "video/3gpp"
   163  	MIMEVideoAVI           = "video/x-msvideo"
   164  	MIMEVideoMatroska      = "video/x-matroska"
   165  )