The best way to check flanges is to place them on a known flat straight surface with a light source behind one side of the ******. Look for light seepage on the other side of the ******.
This would need the headers to be off the vehicle. If they are just unbolted from the head, you can get a known straight metal bar or stock and place it against the head side of the ******. look for any dips, twists, or bends. If you find any the headers need to be removed and "worked" ( heat, hammer , grind , file.) to be made straight. In extreme cases I have known guys that had to take them to machine shops, but this is only an option for products that have thick enough flanges. Sometimes the cost isn't worth the effort and new headers are in order,...but that is, as I said, extreme.
If you just have a "tic", that is from the header, a little work and new gaskets , and bolts could be the answer.
Good Luck