This is part of the Public Health (Control of Disease) Act 1984, sections 33 and 34: Public Conveyances. The taxi driver has a right to refuse anyone who may have a notifiable disease, or they may elect to transport you and then immediately disinfect their vehicle (unlike a bus driver, who must refuse you altogether). Some of the other notifiable diseases listed include plague, rabies, food poisoning and leprosy.
16.70.740 Acts Prohibited. Between the hours of 9 p.m. and 5 a.m. of the following morning, no vehicle may pass along or across a traffic congestion thoroughfare, designated as such by signs as described in Section 16.70.730, more than two times.
Although not enforced in modern times, this law is still on the books. In fact, there is an annual ceremony of the Constable’s Dues, where the Royal Navy moors one of its boats alongside the Tower Pier and the captain delivers his “tax”.