Please switch to TARGETURI and code will be as simply as:

```ruby
			uri = target_uri.path
			uri << '/' if uri[-1,1] != '/'

			res = send_request_cgi(
			{
				'uri'    => "#{uri}",
				'method' => 'HEAD'
			})

```ruby