File tree Expand file tree Collapse file tree 7 files changed +351
-156
lines changed Expand file tree Collapse file tree 7 files changed +351
-156
lines changed Original file line number Diff line number Diff line change
1
+ // Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
2
+
1
3
// Copyright 2021 The Go Authors. All rights reserved.
2
4
// Use of this source code is governed by a BSD-style
3
5
// license that can be found in the LICENSE file.
Original file line number Diff line number Diff line change 1
1
package parsehttp2frame
2
2
3
+ // Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
4
+
3
5
import (
4
6
"fmt"
5
- "net/http/httputil"
6
7
7
8
"golang.org/x/net/http2"
8
9
)
9
10
10
- func Frame2String (f http2.Frame ) (string , error ) {
11
+ func Dump (f http2.Frame ) (string , error ) {
11
12
switch f := f .(type ) {
12
13
case * http2.SettingsFrame :
13
14
return fmt .Sprintf ("%#v" , f ), nil
14
15
case * http2.MetaHeadersFrame :
15
- req , err := processHeaders (f )
16
- if err != nil {
17
- return "" , err
18
- }
19
- b , err := httputil .DumpRequest (req , false )
20
- return string (b ), err
16
+ return DumpMetaHeaders (f )
21
17
case * http2.WindowUpdateFrame :
22
18
return fmt .Sprintf ("%#v" , f ), nil
23
19
case * http2.PingFrame :
Original file line number Diff line number Diff line change
1
+ // Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
2
+
1
3
// Copyright 2014 The Go Authors. All rights reserved.
2
4
// Use of this source code is governed by a BSD-style
3
5
// license that can be found in the LICENSE file.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments