He also attacked a woman in her thirties.
Alex Wood grabbed his victim by the chest and hit her on the head with a can last Tuesday night in Wantage.
Police attended the scene and Wood was arrested. During his arrest he spat in an officer's face.
The 37-year-old, from Bridge End, Dorchester-upon-Thames, pleaded guilty to two counts of assault and one count of criminal damage at Oxford Magistrates Court on Wednesday.
He was sentenced to a total of 22 weeks behind bars.
The police officer is currently receiving welfare support and was wearing a protective face mask at the time of the incident.
Deputy Local Policing Area Commander for South Oxfordshire and Vale of White Horse, Chief Inspector Matt Bullivant, said: "Our role is primarily to protect life and limb. That is any member of the public, victims of crime and persons suspected of crime.
"Wood made this deliberate act, seemingly trying to threaten an officer with potentially contracting something from him.
"This is obviously totally inappropriate behaviour at any time, but particularly at this time of the Covid-19 pandemic, and I’m pleased the courts have dealt with this appropriately, and also for the victim of the offence that we were called to initially.”
Chairman of Thames Valley Police Federation, Craig O’Leary, said: “This custodial sentence is welcomed as there is no place for behaviour such as this.
"Wood had assaulted a woman and then by his actions and words, deliberately coughed at the arresting officer.
"Coughing on an officer deliberately in the current climate is completely unacceptable.
"Our officer maintained his professionalism and was wearing the appropriate personal protective equipment.
"However, the behaviour of Wood was absolutely abhorrent and I am pleased that the courts saw the seriousness of all these offences and gave him an immediate custodial sentence.
"Our police officers and other members of the emergency services are there to protect the public, and behaviour such as this towards them will not be tolerated.
"The vast majority of the community are showing tremendous support to our officers, and thankfully, incidents such as this are very rare.”