middlewares - only scan if url is not null