I suggest to make below changes:
```
 +                String targetUrl = url;
 +                URI targetUri = null;
 +                
 +                try {
 +                    targetUri = new URI(url);
 +                    if (!targetUri.isAbsolute()) {
                           URI baseUri = new URI(baseUrl);;
 +                        targetUrl = baseUri.resolve(targetUri).toString();
 +                    }
```
We don't have to create baseUri if the targetUri is an absolute one. what do you think?
@kurli