From e90b23bf97fe0e119160bc7cce6f1f4d628b73c3 Mon Sep 17 00:00:00 2001 From: Max Claus Nunes Date: Tue, 29 Aug 2017 17:04:15 -0300 Subject: [PATCH] Unescape request URL before matching url --- httpfake.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpfake.go b/httpfake.go index c5459ae..9128443 100644 --- a/httpfake.go +++ b/httpfake.go @@ -9,6 +9,7 @@ import ( "fmt" "net/http" "net/http/httptest" + netURL "net/url" "strings" ) @@ -69,7 +70,7 @@ func (f *HTTPFake) findHandler(r *http.Request) *Request { continue } - rhURL := rh.URL.String() + rhURL, _ := netURL.QueryUnescape(rh.URL.String()) if rhURL == url { return rh }