CancelRequest recursively calls itself leading to `fatal error: stack overflow`
ajwerner opened this issue · comments
ajwerner commented
// CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface
func (r *Recorder) CancelRequest(req *http.Request) {
r.CancelRequest(req)
}
https://github.com/dnaeon/go-vcr/blob/master/recorder/recorder.go#L214
Should probably be:
// CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface
func (r *Recorder) CancelRequest(req *http.Request) {
// copy the interface to not import etcd/client
type cancelableTransport interface {
CancelRequest(req *http.Request)
}
if ct, ok := r.realTransport.(cancelableTransport); ok {
ct.CancelRequest(req)
}
}
Marin Atanasov Nikolov commented
Please consider submitting a PR, thanks! :)
…On Fri, Sep 22, 2017 at 18:53 ajwerner ***@***.***> wrote:
// CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface
func (r *Recorder) CancelRequest(req *http.Request) {
r.CancelRequest(req)
}
https://github.com/dnaeon/go-vcr/blob/master/recorder/recorder.go#L214
Should probably be:
// CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface
func (r *Recorder) CancelRequest(req *http.Request) {
// copy the interface to not import etcd/client
type cancelableTransport interface {
CancelRequest(req *http.Request)
}
if ct, ok := r.realTransport.(cancelableTransport); ok {
ct.CancelRequest(req)
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAO0i65lrTnU7v7EHshWbCZjtVoEOePeks5sk9fqgaJpZM4Pg5m6>
.