Use util/https? in middleware