Skip to content

Commit

Permalink
Merge pull request #1 from h0x0er/refactor
Browse files Browse the repository at this point in the history
Major refactoring
  • Loading branch information
h0x0er authored Nov 7, 2023
2 parents d7184fe + 4fc2c72 commit 199a041
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 156 deletions.
2 changes: 2 additions & 0 deletions ascii.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2

// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
12 changes: 4 additions & 8 deletions process_frame.go → dump.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package parsehttp2frame

// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2

import (
"fmt"
"net/http/httputil"

"golang.org/x/net/http2"
)

func Frame2String(f http2.Frame) (string, error) {
func Dump(f http2.Frame) (string, error) {
switch f := f.(type) {
case *http2.SettingsFrame:
return fmt.Sprintf("%#v", f), nil
case *http2.MetaHeadersFrame:
req, err := processHeaders(f)
if err != nil {
return "", err
}
b, err := httputil.DumpRequest(req, false)
return string(b), err
return DumpMetaHeaders(f)
case *http2.WindowUpdateFrame:
return fmt.Sprintf("%#v", f), nil
case *http2.PingFrame:
Expand Down
2 changes: 2 additions & 0 deletions headermap.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Note: Code is taken from https://cs.opensource.google/go/x/net/+/master:http2

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
148 changes: 0 additions & 148 deletions process_headers.go

This file was deleted.

Loading

0 comments on commit 199a041

Please sign in to comment.