Avoid calling http_head for non-HTTP URLs
Avoid calling `http_head` for non-HTTP URLs, by adding and `else` statement.

Currently, it makes an unnecessary HTTP call (which adds latency) for non-HTTP protocols, like FTP, S3,...

I discovered this while working in an unrelated issue.