Shaikh Ibn ul-‘Uthaymeen rahimahullah said:

“The Sunnah is that you do not eat every food you do not desire. This is likewise the opinion in medicine. However, the doctors differed: if the mouth desires [a certain food], but the stomach does not, which one of them precedes? The stomach, correct. This is because the pleasure of the tongue is temporary; however, the fatigue of the stomach will be continuous. It is a mistake. Some people desire certain things; however, if they eat it or drink it, they will get a great amount of gas in their stomach. It bothers them. We say:  as long as you know this about your stomach and you will be in need [of curing] your stomach if you eat it, then do not eat it. Do you understand? Some people have a specific sickness [e.g. food allergies] which prohibits them from eating certain foods, but they desire it. We say: do not eat it, except in a small amount which is necessary.[Then] There is no harm [in that]”

[Sharh Saheeh al-Bukhari- Bab al-Tamanni wa Kitab al-‘Itisaam bi Kitab was-Sunnah no. 3 side A]
Note: The Proof for this is the following:

عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ مَا عَابَ النَّبِيُّ صلى الله عليه وسلم طَعَامًا قَطُّ، إِنِ اشْتَهَاهُ أَكَلَهُ، وَإِلاَّ تَرَكَهُ

Narrated Abu Huraira:

The Prophet (ﷺ) never criticized any food (presented him), but he would eat it if he liked it; otherwise, he would leave it (without expressing his dislike).

[Reported by al-Bukhari no. 3563]
Translated by

Faisal Ibn Abdul Qaadir Ibn Hassan
Abu Sulaymaan