Actually maybe a 40 mm headset will fit too, remember that the lockring is about 5 mm height depending on the brand and headset model and pretty much u need to have at least 2.5 mm of the lockring in the threads too.
Pretty much almost all the good headsets are between 35 and 42 mm stack just in case.
Good luck.