As images of President Obama and the first lady, Michelle Obama, with the new Saudi leader, King Salman, circulated online after their brief visit to Riyadh on Tuesday, commentators, observers watching from afar, seized on the fact that Mrs. Obama had not covered her hair during the audience with the new monarch.

Reports that some Saudi bloggers had expressed anger at the first lady’s supposed show of defiance — in refusing to honor the Saudi custom that compels women in the conservative kingdom to wear headscarves or full-body cloaks — were followed by a chorus of online praise for Mrs. Obama. They were joined even by one of the president’s most avid critics, Senator Ted Cruz, the Texas Republican who perhaps hopes to succeed him.