mtulio / go-url

go-url is a cool URL tester that discovers all endpoints (IP address) and makes HTTP/S requests to each. It also can push metrics to the Pushgateway.
Apache License 2.0
5 stars 0 forks source link

fix/validation-url: add Raw path when it's not defined #9

Closed mtulio closed 5 years ago

mtulio commented 5 years ago

Full path is not append to the request when DNS resolver is true:

$ go run *.go -dns -url='https://www.google.com/search?source=hp&q=google'
#> Reading config from Param
#> Found [1] URLs to test, starting...

URL=[(www.google.com) https://[2607:f8b0:4004:805::2004]:443/search] [FAIL] : 
     Get https://[2607:f8b0:4004:805::2004]:443/search: dial tcp [2607:f8b0:4004:805::2004]:443: connect: network is unreachable [DNS 151 ms]
URL=[         (www.google.com) https://172.217.164.164:443/search] [  OK] : [200 OK] [1501 ms] [DNS 151 ms]
Total time taken: 1654ms
$ go run *.go -dns -url='https://www.google.com/search?source=hp&q=google'
#> Reading config from Param
#> Found [1] URLs to test, starting...

URL=[(www.google.com) https://[2607:f8b0:4004:811::2004]:443/search?source=hp&q=google] [FAIL] : 
     Get https://[2607:f8b0:4004:811::2004]:443/search?source=hp&q=google: dial tcp [2607:f8b0:4004:811::2004]:443: connect: network is unreachable [DNS 147 ms]
URL=[(www.google.com) https://172.217.8.4:443/search?source=hp&q=google] [  OK] : [200 OK] [871 ms] [DNS 147 ms]
Total time taken: 1019ms