proxy interceptors implicitly modify arguments, instead of returning them

This commit is contained in:
Paul Bellamy committed 2015-05-19 10:34:46 +01:00
1 parent 126d4f4079
commit 2f8c5d7bd9
4 files changed
+26 -26

No files matched your search

+6 -6
View File
@@ -3,17 +3,17 @@ package proxy
import "net/http"
type interceptor interface {
InterceptRequest(*http.Request) (*http.Request, error)
InterceptResponse(*http.Response) (*http.Response, error)
InterceptRequest(*http.Request) error
InterceptResponse(*http.Response) error
}
type nullInterceptor struct {
}
func (i nullInterceptor) InterceptRequest(r *http.Request) (*http.Request, error) {
return r, nil
func (i nullInterceptor) InterceptRequest(r *http.Request) error {
return nil
}
func (i nullInterceptor) InterceptResponse(r *http.Response) (*http.Response, error) {
return r, nil
func (i nullInterceptor) InterceptResponse(r *http.Response) error {
return nil
}