We are hopefully going to fix this in k6 v0.30, since it’s too late to fit it into k6 v0.29.0 (slated for release next week). Until then, if making sure all URLs are invalid is impossible (if that is the case, can you elaborate why?), I’d suggest maybe using a wrapper around http.request() calls that either catches any exceptions or checks for URL validity itself and doesn’t execute requests for invalid URLs?
Unfortunately, k6 isn’t really capable of sending invalid HTTP requests to servers. We’ll have raw TCP support eventually, and you’d be able to do it that way, but the k6/http module depends on the standard Go net/http library, which has a lot of sanity checks for RFC compliance.