Skip to content

Commit e01e7cc

Browse files
committed
Rename to handlePrefaceOrH2CRequest
1 parent bba783a commit e01e7cc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mitm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ func (r *mitmProxyHandler) handleTunnelRequest(ctx context.Context, consumedRequ
683683
return r.relayConnForHTTP(ctx, srcConn)
684684
}
685685

686-
func (r *mitmProxyHandler) handleH2CRequest(ctx context.Context, rw http.ResponseWriter, req *http.Request) (bool, error) {
686+
func (r *mitmProxyHandler) handlePrefaceOrH2CRequest(ctx context.Context, rw http.ResponseWriter, req *http.Request) (bool, error) {
687687
// Handle h2c with prior knowledge (RFC 7540 Section 3.4)
688688
if req.Method == "PRI" && len(req.Header) == 0 && req.URL.Path == "*" && req.Proto == "HTTP/2.0" {
689689
conn, err := initH2CWithPriorKnowledge(rw)
@@ -750,7 +750,7 @@ func (r *mitmProxyHandler) distinguishHTTPRequest(ctx context.Context, srcConn n
750750

751751
if !r.disableHTTP2 {
752752
// If it's a SOCKS proxy, then the request might be h2c.
753-
earlyDone, retErr = r.handleH2CRequest(ctx, fakerw, request)
753+
earlyDone, retErr = r.handlePrefaceOrH2CRequest(ctx, fakerw, request)
754754
if retErr != nil || earlyDone {
755755
return
756756
}

0 commit comments

Comments
 (0)