Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: web_page_replay_go/src/webpagereplay/proxy.go

Issue 2943103003: Migrate web-page-replay-go files (Closed)
Patch Set: self Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698