1 //
2 // ========================================================================
3 // Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
4 // ------------------------------------------------------------------------
5 // All rights reserved. This program and the accompanying materials
6 // are made available under the terms of the Eclipse Public License v1.0
7 // and Apache License v2.0 which accompanies this distribution.
8 //
9 // The Eclipse Public License is available at
10 // http://www.eclipse.org/legal/epl-v10.html
11 //
12 // The Apache License v2.0 is available at
13 // http://www.opensource.org/licenses/apache2.0.php
14 //
15 // You may elect to redistribute this code under either of these licenses.
16 // ========================================================================
17 //
18
19 package org.eclipse.jetty.http2.frames;
20
21 import java.nio.charset.StandardCharsets;
22
23 public class PrefaceFrame extends Frame
24 {
25 /**
26 * The bytes of the HTTP/2 preface that form a legal HTTP/1.1
27 * request, used in the direct upgrade.
28 */
29 public static final byte[] PREFACE_PREAMBLE_BYTES = (
30 "PRI * HTTP/2.0\r\n" +
31 "\r\n"
32 ).getBytes(StandardCharsets.US_ASCII);
33
34 /**
35 * The HTTP/2 preface bytes.
36 */
37 public static final byte[] PREFACE_BYTES = (
38 "PRI * HTTP/2.0\r\n" +
39 "\r\n" +
40 "SM\r\n" +
41 "\r\n"
42 ).getBytes(StandardCharsets.US_ASCII);
43
44 public PrefaceFrame()
45 {
46 super(FrameType.PREFACE);
47 }
48 }