It is narrated from Sayyiduna Hamzah Aslami that he asked the Prophet (peace and blessings be upon him) about the ruling of fasting while traveling: so the Prophet (peace and blessings be upon him) said: If you wish, then fast, and if you wish, then do not fast.