Skip to content

Commit

Permalink
add RawResponse *http.Response to HijackResponse (#1001)
Browse files Browse the repository at this point in the history
Co-authored-by: dc3x6 <dc3x6>
  • Loading branch information
DC3x6 committed Jan 9, 2024
1 parent ced12b5 commit 5d7b145
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hijack.go
Expand Up @@ -230,6 +230,7 @@ func (h *Hijack) LoadResponse(client *http.Client, loadBody bool) error {
defer func() { _ = res.Body.Close() }()

h.Response.payload.ResponseCode = res.StatusCode
h.Response.RawResponse = res

for k, vs := range res.Header {
for _, v := range vs {
Expand Down Expand Up @@ -326,8 +327,9 @@ func (ctx *HijackRequest) IsNavigation() bool {

// HijackResponse context
type HijackResponse struct {
payload *proto.FetchFulfillRequest
fail *proto.FetchFailRequest
payload *proto.FetchFulfillRequest
RawResponse *http.Response
fail *proto.FetchFailRequest
}

// Payload to respond the request from the browser.
Expand Down

0 comments on commit 5d7b145

Please sign in to comment.