Fix URL handling

Current implementation doesn't allow URLs with port (i.e.: `http://domain.com:8080/path`)