Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5d7b145

Browse files
authoredJan 9, 2024
add RawResponse *http.Response to HijackResponse (#1001)
Co-authored-by: dc3x6 <dc3x6>
1 parent ced12b5 commit 5d7b145

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎hijack.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ func (h *Hijack) LoadResponse(client *http.Client, loadBody bool) error {
230230
defer func() { _ = res.Body.Close() }()
231231

232232
h.Response.payload.ResponseCode = res.StatusCode
233+
h.Response.RawResponse = res
233234

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

327328
// HijackResponse context
328329
type HijackResponse struct {
329-
payload *proto.FetchFulfillRequest
330-
fail *proto.FetchFailRequest
330+
payload *proto.FetchFulfillRequest
331+
RawResponse *http.Response
332+
fail *proto.FetchFailRequest
331333
}
332334

333335
// Payload to respond the request from the browser.

0 commit comments

Comments
 (0)
Please sign in to comment.