Heartbroken.. Dont know what to do.

I met my boyfriend eight years ago. We were 15 when we met and alot of mistakes were made growing up together. We are both now twenty three years old. He treats me exactly how i want to be treated. Lets me know that he only wants a future and family with me and that he wants to start a family in two years with me. Everything was going perfect and has been for years until i recently found out he had an online fling for months four years ago when he was 18 and we were going through an extreme rough patch(still not an excuse). I love this man with all of my heart but im heartbroken. Idk if i should just walk away. Advice please.