proxy interceptors implicitly modify arguments, instead of returning them
This commit is contained in:
1 parent
126d4f4079
commit
2f8c5d7bd9
4 files changed
+26
-26
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user