שולחן ערוך אורח חיים הלכות תפלה סימן צא
יש אומרים שאסור להוציא אזכרה מפיו בראש מגולה, * וי"א שיש למחות שלא ליכנס בבהכ"נ בגלוי הראש.
כובעים, (קפיל"ה בלעז) הקלועים מקש, חשיבא כסוי, אבל הנחת יד על הראש לא חשיבא כסוי; ואם אחר מניח ידו על ראשו של זה, משמע דחשיבא כסוי.
ה לא יעמוד באפונדתו (טאסק"ה בלעז) ולא בראש מגולה ולא ברגלים מגולים, אם דרך אנשי המקום שלא יעמדו לפני הגדולים אלא בבתי רגלים.
Translation:91:3 There are those who say that it is forbidden to say the name of G-d with an uncovered head, and there are those who say that there is reason to object [and say] one should not enter a synagogue with an uncovered head.
91:4 Hats (Kipeleh in the vernacular) that are plaited from straw are considered a covering, but putting the hand on the head is not considered covering; and if another person rests his hand on this person's head, it is considered a covering.
91:5 One should not stand with his money bag/purse, and not with an uncovered head, and not with uncovered legs, if the way of people in that place is not to stand before the great without shoes.
Once again, we tangle with the question of whether all of this grammatically masculine halakha is addressed only to men, primarily to men, or is only assumed by later/any readership to only mean men. I will note (as I have done before, I'm sure) that in many contexts similar to that of the Mechaber, unmarried women covered their heads in some way as a social norm. This makes it hard to determine whether he was even considering what was required of women, or whether he assumed that the rules were the same, or if he had some other considerations that I have not yet found for women's heads and prayer.
I would never have questioned the validity of a straw hat, which the Shulhan Arukh here feels a need to state qualifies as a hat- I suppose a straw hat is a very flimsy sort of covering compared to a turban. Interesting to see it here as a further note as to the way that our social perceptions of dress influence how we shape the boundaries of halakha. Here's codification of something I would have never questioned- and therefore would never have addressed as question in need of answering.
Head-covering here seems to be a matter of showing respect, especially given that 91:5 makes an explicit analogy between the way you dress for prayer and the way you would dress to be in the company of an important person. This one does reflect an awareness of differences of cultural norms, mostly around how one clothes one's legs, that suggests that the earlier sections about head covering are less socially-defined than permanently set as a symbol of respect or awe.