Fixed check on invalid URLs for POST request