Selaa lähdekoodia

Support matching query strings

Lu Stadler 7 vuotta sitten
vanhempi
commit
d199d2f8ea
2 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 0 1
      go/fake-http/README.md
  2. 1 1
      go/fake-http/fake-http.go

+ 0 - 1
go/fake-http/README.md

@ -2,7 +2,6 @@
2 2
3 3
## TODO
4 4
5
- support matching query strings
6 5
- refactoring
7 6
- /_clear endpoint
8 7
- some kind of templating (request info + random functions?)

+ 1 - 1
go/fake-http/fake-http.go

@ -335,7 +335,7 @@ type Responses []Response
335 335
// Match returns a response definition matching the request.
336 336
func (rs *Responses) Match(req *http.Request) *Response {
337 337
	for _, resp := range *rs {
338
		if req.Method == resp.Method && req.URL.Path == resp.Path {
338
		if req.Method == resp.Method && req.URL.String() == resp.Path {
339 339
			return &resp
340 340
		}
341 341
	}