| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package webpagereplay | 5 package webpagereplay |
| 6 | 6 |
| 7 mport ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "fmt" | 9 "fmt" |
| 10 "io" | 10 "io" |
| 11 "io/ioutil" | 11 "io/ioutil" |
| 12 "log" | 12 "log" |
| 13 "net/http" | 13 "net/http" |
| 14 "os" | 14 "os" |
| 15 "strconv" | 15 "strconv" |
| 16 "strings" | 16 "strings" |
| 17 ) | 17 ) |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // Restore the req/resp body before archiving. | 202 // Restore the req/resp body before archiving. |
| 203 // The req body was consumed by RoundTrip, and the resp body was consume
d by the above io.Copy. | 203 // The req body was consumed by RoundTrip, and the resp body was consume
d by the above io.Copy. |
| 204 if req.Body != nil { | 204 if req.Body != nil { |
| 205 req.Body = ioutil.NopCloser(bytes.NewReader(requestBody)) | 205 req.Body = ioutil.NopCloser(bytes.NewReader(requestBody)) |
| 206 } | 206 } |
| 207 resp.Body = ioutil.NopCloser(bytes.NewReader(responseBody)) | 207 resp.Body = ioutil.NopCloser(bytes.NewReader(responseBody)) |
| 208 if err := proxy.a.RecordRequest(proxy.scheme, req, resp); err != nil { | 208 if err := proxy.a.RecordRequest(proxy.scheme, req, resp); err != nil { |
| 209 logf("failed recording request: %v", err) | 209 logf("failed recording request: %v", err) |
| 210 } | 210 } |
| 211 } | 211 } |
| OLD | NEW |