|
|
@ -221,15 +221,6 @@ func respondWithStub(responses []Response, w http.ResponseWriter, req *http.Requ
|
|
221
|
221
|
}
|
|
222
|
222
|
|
|
223
|
223
|
func respondWithProxy(proxyURL string, w http.ResponseWriter, req *http.Request) *http.Response {
|
|
224
|
|
/*proxyReq, err := http.NewRequest(req.Method, proxyURL+req.URL.Path, nil)
|
|
225
|
|
if err != nil {
|
|
226
|
|
log.Printf("Error: Creating proxy request: %s", err)
|
|
227
|
|
return nil
|
|
228
|
|
}
|
|
229
|
|
for name, vals := range req.Header {
|
|
230
|
|
proxyReq.Header[name] = vals
|
|
231
|
|
}*/
|
|
232
|
|
|
|
233
|
224
|
proxyTransport := &http.Transport{
|
|
234
|
225
|
TLSClientConfig: &tls.Config{
|
|
235
|
226
|
GetClientCertificate: func(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
|
|
|
@ -380,17 +371,6 @@ type Header struct {
|
|
380
|
371
|
Value string `yaml:"value"`
|
|
381
|
372
|
}
|
|
382
|
373
|
|
|
383
|
|
// JSONResponse creates a Response with "Content-Type: application/json".
|
|
384
|
|
func JSONResponse(method, path, body string) Response {
|
|
385
|
|
return Response{
|
|
386
|
|
Method: method,
|
|
387
|
|
Path: path,
|
|
388
|
|
Status: 200,
|
|
389
|
|
Headers: []Header{Header{Name: "Content-Type", Value: "application/json"}},
|
|
390
|
|
Body: body,
|
|
391
|
|
}
|
|
392
|
|
}
|
|
393
|
|
|
|
394
|
374
|
func readResponse(form url.Values) Response {
|
|
395
|
375
|
r := Response{}
|
|
396
|
376
|
r.Method = form.Get("method")
|