Skip to content

Commit 199a041

Browse files
authored
Merge pull request #1 from h0x0er/refactor
Major refactoring
2 parents d7184fe + 4fc2c72 commit 199a041

File tree

7 files changed

+351
-156
lines changed

7 files changed

+351
-156
lines changed

ascii.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
2+
13
// Copyright 2021 The Go Authors. All rights reserved.
24
// Use of this source code is governed by a BSD-style
35
// license that can be found in the LICENSE file.

process_frame.go renamed to dump.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
package parsehttp2frame
22

3+
// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
4+
35
import (
46
"fmt"
5-
"net/http/httputil"
67

78
"golang.org/x/net/http2"
89
)
910

10-
func Frame2String(f http2.Frame) (string, error) {
11+
func Dump(f http2.Frame) (string, error) {
1112
switch f := f.(type) {
1213
case *http2.SettingsFrame:
1314
return fmt.Sprintf("%#v", f), nil
1415
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)
2117
case *http2.WindowUpdateFrame:
2218
return fmt.Sprintf("%#v", f), nil
2319
case *http2.PingFrame:

headermap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2
2+
13
// Copyright 2014 The Go Authors. All rights reserved.
24
// Use of this source code is governed by a BSD-style
35
// license that can be found in the LICENSE file.

process_headers.go

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)